this post was submitted on 11 Aug 2024
211 points (97.7% liked)

Lemmy Apps

5485 readers
4 users here now

A home for discussion of Lemmy apps and tools for all platforms.

RULES:


An extensive list of Lemmy apps is available here:

LemmyApps.com

or lemmyapps.netlify.app


Visit our partner Communities!

Lemmy Plugins and Userscripts is a great place to enhance the Lemmy browsing experience. [email protected]

Lemmy Integrations is a community about all integrations with the lemmy API. Bots, Scripts, New Apps, etc. [email protected]

Lemmy Bots and Tools is a place to discuss and show off bots, tools, front ends, etc. you’re making that relate to lemmy. [email protected]

Lemmy App Development is a place for Lemmy builders to chat about building apps, clients, tools and bots for the Lemmy platform. [email protected]

founded 1 year ago
MODERATORS
 

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
[–] [email protected] 2 points 3 months ago* (last edited 3 months ago) (1 children)

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.

[–] [email protected] 1 points 3 months ago (1 children)

Not necessarily. You have to be able to tell between language strings vs strings that are supposed to be hardcoded

[–] [email protected] 1 points 3 months ago

Ok, that's fair. I'd probably add a # FIXXME flag when I don't want to mess around with that stuff for the moment to do that.