![]() ![]() synthetic-package Determines whether or not the generated output files will be generated as a synthetic package or at a specified directory in the Flutter project. When null, the JSON file will not be generated. The value of this option is the directory where the JSON file will be generated. For example, the Flutter tool's build system uses this file to keep track of when to call gen_l10n during hot reload. This can be useful for keeping track of which files of the Flutter project were used when generating the latest set of localizations. gen-inputs-and-outputs-list= When specified, the tool generates a JSON file containing the tool's inputs and outputs named gen_l10n_inputs_and_outputs.json. This flag does not affect other platforms such as mobile or desktop. For projects with a small number of locales, the difference is negligible, and might slow down the start up compared to bundling the localizations with the rest of the application. For projects with a lot of different locales and many localization strings, it can be an performance improvement to have deferred loading. When this flag is set to true, the messages for a particular locale are only downloaded and loaded by the Flutter app as they are needed. This can reduce a web app’s initial startup time by decreasing the size of the JavaScript bundle. use-deferred-loading Whether to generate the Dart localization file with locales imported as deferred, allowing for lazy loading of each locale in Flutter web. This file should be placed in the directory specified in "-arb-dir". The value of this option is the name of the file that contains the header text which will be inserted at the top of each generated Dart file.Īlternatively, see the "-header" option to pass in a string for a simpler header. ![]() header-file The header to prepend to the generated Dart localizations files. This option takes in a string.įor example, pass in "/// All localized files." if you would like this string prepended to the generated Dart file.Īlternatively, see the "-header-file" option to pass in a text file for longer headers. header The header to prepend to the generated Dart localizations files. Pass this option multiple times to define multiple items. For example, pass in "en_US" if you would like your app to default to American English on devices that support it. Use this flag if you would like to default to a different locale. By default, the tool will generate the supported locales list in alphabetical order. preferred-supported-locales= The list of preferred supported locales for the application. output-class The Dart class name to use for the output localization and localizations delegate classes. If this option is not specified, a summary of the messages that have not been translated will be printed on the command line. Using this option will create a JSON file at the target location, in the following format: untranslated-messages-file The location of a file that describes the localization messages have not been translated yet. output-localization-file The filename for the output localization and localizations delegate classes. template-arb-file The template arb file that will be used as the basis for generating the Dart localization and messages files. If unspecified, this defaults to the same directory as the input directory specified in "-arb-dir". The app must import the file specified in the "-output-localization-file" option from this directory. ![]() If output-dir is specified and the synthetic-package flag is enabled, this option will be ignored by the tool. ![]() output-dir The directory where the generated localization classes will be written if the synthetic-package flag is set to false. arb-dir The directory where the template and translated arb files are located. suppress-analytics Suppress analytics reporting when this command runs. version Reports the version of this tool. d, -device-id Target device id or name (prefixes allowed). (Use "-vv" to force verbose logging in those cases.) If used with "flutter doctor", shows additional diagnostic information. If used with "-help", shows hidden options. v, -verbose Noisy logging, including all shell commands executed. Generate localizations for the current project. For your convenience, this is the actual output: app % fvm flutter gen-l10n -h There are more configurable options than there are mentioned in the official documentation. If you want to know all the options there are for localization, it is a good idea to run this command and examine the output. I have some tips and tricks that I would like to share with you. This works pretty well and you can find the official documentation here: Since Flutter version 1.22, Flutter has built-in support for localization. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |