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!

  • morrowind@lemmy.ml
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    3 months ago

    Is it really more effort to just extract relevant strings later, rather than worrying about it the whole time? Asking beyond lemmy apps too.

    • misery mansion@lemmy.world
      link
      fedilink
      arrow-up
      7
      ·
      3 months ago

      Once you have this set up, you won’t worry about it again. It will just become “the way it is done”. And it’s just the correct way to build software IMHO, even if you have no plans right now to offer multiple languages.

    • jimmy90@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      3 months ago

      for things like translation it is obviously required, but it will be ongoing as the app changes over the years

      so it’s just about realising that text in the UI is just another kind of content that has to be managed so there will need to be infrastructure and process to make that easier