flutter_pseudolocalizor 0.3.0
flutter_pseudolocalizor: ^0.3.0 copied to clipboard

Dart native
Flutter Android iOS Linux macOS Windows

A Pseudolocalization tool for Flutter and Dart which generates pseudo, nonsensical translations for multiple languages from a given English source.

example/README.md

Example #

Firstly, add the package as a dev dependency:

dev_dependencies: 
  flutter_pseudolocalizor: 

Next define settings in pubspec.yaml for the package:

flutter_pseudolocalizor:
  input_filepath: "test.csv"
  replace_base: false
  use_brackets: true
  text_expansion_ratio: null
  languages_to_generate:
    - de
    - pl
    - ru
  csv_settings:
    delimiter: ";"
    column_index: 1
  patterns_to_ignore:
    - '%(\S*?)\$[ds]'
    - 'Flutter'
SettingDescription
input_filepathA path to the input localization file.
output_filepathA path for the generated output file. Defaults to <input_filename>-PSEUDO.<extension>.
replace_baseWhether the base language (en) should be replaced. Defaults to false.
text_expansion_ratioThe ratio (between 1 and 3) of text expansion. If null, uses a linear function.
languages_to_generateAn array of languages to generate. Ignored if replace_base is true.
csv_settings: delimiterA delimiter to separate columns in the input CSV file. Defaults to ,.
csv_settings: column_indexThe column index of the base language (en) in the input CSV file. Defaults to 1.
patterns_to_ignoreA list of patterns to ignore during text replacement.

input_filepath must be given, all other settings are optional. If Latin-1 Supplement and Latin Extended-A letters should be tested, set replace_base to true. To test specific languages, set languages_to_generate with an array of languages.

Ensure that your current working directory is the project root. Given the localization file test.csv, simply run the terminal command:

flutter pub run flutter_pseudolocalizor

to generate test-PSEUDO.csv. This generated file can then be incorporated into your dev build using a package like flappy_translator.

Note that patterns_to_ignore is especially useful to avoid text replacement for certain know constructs, for instance a product name or a pattern ``%myVar$d` used to parse variables from text.

2
likes
80
pub points
0%
popularity

Publisher

defuncart.com

A Pseudolocalization tool for Flutter and Dart which generates pseudo, nonsensical translations for multiple languages from a given English source.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

meta, yaml

More

Packages that depend on flutter_pseudolocalizor