resamsel / translatr

I18n Translation Management
https://translatr.repanzar.com
GNU General Public License v3.0
8 stars 1 forks source link

Add tags to keys #175

Open resamsel opened 4 years ago

resamsel commented 4 years ago

When pushing or pulling translations, tags should be used to determine the scope of the operation. A mono-repo approach could lead to having several applications (i.e. backend, ui, admin-ui), which use different keys. Additionally, versioning can be done using this approach. Only relevant keys need to be pulled for a specific version. Tag management needs to be provided in the UI.

The config file translatr.yml should be enhanced to allow tagging.

translatr:
  ...
  pull:
    file_type: play_messages
    target: conf/messages.?{locale.name}
    tags: app:backend version:1.0.0
  push:
    file_type: play_messages
    target: conf/messages.?{locale.name}
    tags: app:backend version:1.0.0

When pushing, the related keys found in the targets should be tagged with the given tags (app:backend, version:1.0.0). When pulling, only keys with the given tags (app:backend, version:1.0.0) should be included.