11/10/2023 0 Comments Install flutter intl package![]() If not provided, the intl_utils will use configuration from the pubspec.yaml file or default values (check the Configure package section for more details).Īrgument project-id can be omitted if pubspec.yaml file contains project_id configuration under flutter_intl/localizely section.Īrgument api-token can be omitted if ~/.localizely/credentials.yaml file contains api_token configuration (e.g. This will download all available ARB files from the Localizely platform and put them under arb-dir folder.Īll args are optional. ![]() Download ARB files flutter pub run intl_utils:localizely_download If not provided, the intl_utils will use configuration from the pubspec.yaml file or default values (check the Configure package section for more details). This will upload your main ARB file to Localizely.Īll args are optional. Integration with Localizely # Upload main ARB file flutter pub run intl_utils:localizely_upload_main upload-overwrite -upload-as-reviewed] -upload-tag-added -upload-tag-updated -upload-tag-removed You can also change the output folder from lib/generated to a custom directory by adding the output_dir line in your pubspec.yaml file. This will produce files inside lib/generated directory. To generate boilerplate code for localization, run the generate program inside directory where your pubspec.yaml file is located: flutter pub run intl_utils:generate If you wonder how to format key-values content inside ARB files, here is detailed explanation. You can also change the ARB folder from lib/l10n to a custom directory by adding the arb_dir line in your pubspec.yaml file. Default: falseĪdd one ARB file for each locale you need to support in your Flutter app.Īdd them to lib/l10n folder inside your project, and name them in a following way: intl_.arb.įor example: intl_en.arb or intl_en_GB.arb. Ota_enabled: # Set to true if you want to use Localizely Over-the-air functionality. If not set, all string keys will be considered for download. Default: ĭownload_exclude_tags: # Optional list of tags to be excluded from download (e.g. Default: emptyĭownload_include_tags: # Optional list of tags to be downloaded (e.g. Default: ĭownload_empty_as: # Set to empty|main|skip, to configure how empty translations should be exported from the Localizely platform. Upload_tag_removed: # Optional list of tags to add to removed translations with upload (e.g. Upload_tag_updated: # Optional list of tags to add to updated translations with upload (e.g. Upload_tag_added: # Optional list of tags to add to new translations with upload (e.g. ![]() Upload_as_reviewed: # Set to true if you want to mark uploaded translations as reviewed. Upload_overwrite: # Set to true if you want to overwrite translations with upload. Read more: īranch: # Get it from the “Branches” page on the Localizely platform, in case branching is enabled and you want to use a non-main branch. Localizely: # Optional settings if you use Localizely platform. Must be set to true to generate localization code that is loaded with deferred loading. ![]() Provided value should be a valid path on your system. Sets the directory of generated localization files. Sets the directory of your ARB resource files. Provided value should consist of language code and optional script and country codes separated with underscore (e.g. Sets the main locale used for generating localization files. Sets the name for the generated localization class. Must be set to true to activate the package. Here is a full configuration for the package: flutter_intl:Įnabled: true # Required. for Continuous Integration tools or via CLI) or leave it to Visual Studio Code or IntelliJ/Android Studio plugins to run it automatically whenever you modify ARB files.įollow these steps to get started: Configure package #Īdd package configuration to your pubspec.yaml file. It generates boilerplate code for official Dart Intl library and adds auto-complete for keys in Dart code. Use the Localization package together with **flutter_localization.Dart package that creates a binding between your translations from.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |