This is applicable to almost any piece of software with text in it. When starting your new app, you should make sure you are using a separate language file for the strings in your app. This makes text reusable, and you can change it all in one place.

Once your app gains a community, if you did this, you can also get translators!

With Photon i made the massive mistake of hardcoding everything up until the app became massive, and my PR for un-hardcoding all the strings looks like this:

The amount of lines modified in the GitHub PR. 2,067 lines added, 1,082 removed.

It was worth it though! Because the community has translated it into 11 languages!

you are viewing a single comment's thread
view the rest of the comments
[–] 32 points 2 years ago (1 child)

Alternative interpretation cause i find i18n extremely boring and hate the indirection it adds to a code base : you're telling me I can start making an app without this hassle, and it will only cost me a 2Kloc PR some time in the future. That's a totally manageable price to pay and makes the early dev experience much better (which can have a lot of impact on momentum).

  • source
  • hideshow 2 child comments
  • [–] 2 points 2 years ago* (last edited 2 years ago) (1 child)

    Also: shouldn't the process of searching and replacing strings be quite easy to automate?

    Edit to clarify: I meant searching and replacing hard-coded strings into whatever library handles translateable strings. Not hard-coding different languages.

  • source
  • parent
  • hideshow 2 child comments