Skip to content

Script that removes unused strings in application from all arb files

Notifications You must be signed in to change notification settings

kovaccc/Flutter---clean-localization-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Flutter Localization

This document presents process of converting localization strings from excel/csv file into .arb files required for use in the application. This is applicable only when using https://plugins.jetbrains.com/plugin/13666-flutter-intl plugin.

Converting to .arb format

  • Save excel as .csv file. Use UTF-8 type to get right representation of signed letters from another languages

image

image

  • use arb generator to generate updated .arb files in localization directory of your application. Delimiter parameter is optional and it defaults to ",". You will maybe need to comment some of your dependencies to be able to use this package
arb_generator:
  input_filepath: "translations.csv"
  output_filepath: "lib/l10n"
  filename_prepend: "intl_"
  csv_settings:
    delimiter: ";"
    base_index: 1
  • you will get output .arb files looking like this

image

  • Run this script to remove unused descriptions and other unused strings from your .arb files by adding it to your application directory (clean_intl.py). You will maybe need to adjust root_folders variable in the script depending on your project structure

image

  • You will get cleaned .arb files

image

About

Script that removes unused strings in application from all arb files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages