theLee3 / flutter_auto_translator

A command-line tool to translate ARB files.
BSD 3-Clause "New" or "Revised" License
8 stars 5 forks source link

[Feature request] Retain file organizers during translation #5

Closed orkun1675 closed 10 months ago

orkun1675 commented 10 months ago

Hello,

As you know l10n files can get quite large and hard to maintain. As the number of strings increase it gets difficult to remember which page/widget tthey are used in.

There is an outstanding issue in Flutter that requests splitting up ARB files. In the meantime, we are using the syntax described here to organize our ARB file.

Example:

  "@@locale": "en",
  "@_PAGE_LOGIN": {},
  "loginWithGameServices": "Login with {provider}",
  "@loginWithGameServices": {
    "placeholders": {
      "provider": {
        "type": "String",
        "example": "Game Center"
      }
    }
  },
  "@_PAGE_PLAY": {},
  "saveChanges": "Save",
  "progressNotSaved": "Progress not saved!",

The values with prefix @_ are used as dividers since JSON doesn't support comments.

Would it be possible to retain these lines during the auto translation flow?

This would help human translators navigate the generated auto translation file and fix issues.

theLee3 commented 10 months ago

Done. Also adds @@locale if used in the template.