Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace typesafe-i18n with svelte-i18n #3302

Merged
merged 15 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def get_i18n_settings(manifest_data, development_mode):
client_dev_url = settings.MATHESAR_CLIENT_DEV_URL

if development_mode is True:
module_translations_file_path = f'{client_dev_url}/src/i18n/{display_language}/index.ts'
legacy_translations_file_path = f'{client_dev_url}/src/i18n/{display_language}/index.ts'
module_translations_file_path = f'{client_dev_url}/src/i18n/languages/{display_language}/index.ts'
legacy_translations_file_path = f'{client_dev_url}/src/i18n/languages/{display_language}/index.ts'
else:
try:
module_translations_file_path = static(manifest_data[display_language]["file"])
Expand Down
4 changes: 2 additions & 2 deletions mathesar/utils/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def get_manifest_data():
manifest_data['legacy_js'] = legacy_data['file']

for locale, _ in settings.LANGUAGES or []:
manifest_data[locale] = raw_data[f'src/i18n/{locale}/index.ts']
manifest_data[f"{locale}-legacy"] = raw_data[f'src/i18n/{locale}/index-legacy.ts']
manifest_data[locale] = raw_data[f'src/i18n/languages/{locale}/index.ts']
manifest_data[f"{locale}-legacy"] = raw_data[f'src/i18n/languages/{locale}/index-legacy.ts']

# Cache data for 1 hour
cache.set('manifest_data', manifest_data, 60 * 60)
Expand Down
13 changes: 12 additions & 1 deletion mathesar_ui/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
extraFileExtensions: ['.svelte', '.cjs'],
extraFileExtensions: ['.svelte', '.cjs', '.json'],
},
plugins: ['svelte3', '@typescript-eslint'],
extends: [
Expand Down Expand Up @@ -127,6 +127,17 @@ module.exports = {
],
},
},
{
files: ['src/**/*.json'],
rules: {
'sort-keys': 'error',
'quote-props': 'off',
'@typescript-eslint/quotes': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/semi': 'off',
'@typescript-eslint/comma-dangle': 'off',
},
},
],
env: {
es6: true,
Expand Down
8 changes: 0 additions & 8 deletions mathesar_ui/.typesafe-i18n.json

This file was deleted.

Loading
Loading