-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
chore: prune Weblate translations #13875
base: main
Are you sure you want to change the base?
Conversation
Cleaning up weblate keys that are causing Dart errors with the slang library in mobile. <https://pub.dev/packages/slang>
c657599
to
83d2755
Compare
@@ -483,7 +483,7 @@ | |||
"confirm_password": "تأكيد كلمة المرور", | |||
"contain": "محتواة", | |||
"context": "السياق", | |||
"continue": "متابعة", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a problem? Seems like it should be a bug with the implementation not something we should have to change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The slang
tool generates Dart helper classes to provide fully typed translations. It looks like this:
immich/mobile/lib/i18n/strings_en.g.dart
Line 197 in 37a57d7
String get continue_text => 'Continue'; |
If I leave the key as "continue", I get the following error when building or running flutter:
Error (Xcode): lib/i18n/strings_en.g.dart:197:13: Error:
'continue' can't be used as an identifier because it's a
keyword.
The cause is that the generated code contains a getter using a Dart reserved keyword as a name. I'm not sure how the upstream library would fix this? Open to thoughts here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Id assume the upstream library should not generate invalid code. It should either throw an error or use an alternative naming scheme. It's probably worth opening an issue with them about it. I guess it'd be easy enough to change it either way though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reported an issue upstream!
Description
Cleaning up Weblate keys that are causing Dart errors with the code generation process in the slang Flutter library, which will potentially be used on mobile for translations.
continue
- a reserved keyword in Dart, renamed tocontinue_text
to prevent Dart errorsforce_re-scan_library_files
- the hyphen causes problems with the code generationnote_apply_storage_label_to_previously_uploaded assets
- the space causes problems with code generationdurations
- the object results in additional Dart classes being generated that are not needed and cause Dart inheritance errors, since the object is not present in theen.json
The cleanup needs to be done across all languages, because any translation JSON file that has a malformed key will cause Dart errors.
How Has This Been Tested?
continue_text
key is still working