Extracting messages

Now, we have all the messages separated from the UI and we are ready for translation. We need to extract them from the source code into the external file with a special program called extract_to_arb.dart from the intl package, as shown in the following code:

pub run intl:extract_to_arb --output-dir=web web/registration_form.dart

The preceding program generates the intl_messages.arb file inside the specified web directory. This file contains all the messages in the ARB format. ARB is a localization resource format based on JSON. This format provides the following benefits:

  • Simplicity: This format is simple and human-readable because it is based on JSON
  • Extensibility: In this format, vocabulary can be added without affecting the existing tools and usage
  • Direct usability: Applications can access the resource directly from this format without converting them to another form

You can find more about the ARB format in the specification available at https://code.google.com/p/arb/wiki/ApplicationResourceBundleSpecification.

After this, you can send the files in the ARB format to the human translator. This is done as the form in our case is quite simple and we can translate the files into other languages ourselves by using Google Translator Toolkit.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.9.124