anmolitor/travelm-agency

Prexfix file identifier to translation functions

Closed this issue · 2 comments

Hey, we're using your tool and liking it so far. Something we'd really like though, is the option to prefix translation functions with the file identifier to prevent clashes between files (which now silently overwrite each other):

e.g.

home.en.json

{
  "title": "Hello there"
}

then we run the command to generate the elm file with a --prefixFileIdentifier or something

result in I18n.elm

homeTitle : I18n -> String

Hi, that sounds like a good idea. Should be rather simple to implement, so expect it to be ready in about a week :)

This turned out to be much easier to implement than expected. Since the application state is a Dict Identifier TranslationSet, I can simply map the prefixing function once over the whole thing :)

Hope it works well, the feature should now be live in version 3.1.0.
I renamed the flag to lower snake case (prefix_file_identifier) to be consistent with most of the other flags.