Hello guys I have some questions about the Gettext for internationalization for a two different types of use cases I was thinking.
It is not for create different idioms like is the purpose of the lib.
But to show and hide the code of different type of commands accordingly the Operational System (OS).
I will try to explain better, for example:
- I was thinking about to use the gettext for change the code by selecting the options if the user uses the OS: macos or windows or linux. And using the internationalization rather than using the country like(es, PT) for Spanish and Portuguese. Put the OS you want to show the commands. Like win_os, mac_os, lin_os.
- Other ideia i was thinking is using this for example I write some tutorial or book code or even in the documentation. I have that version of the code with Phoenix 1.4 and you can select like for other version 1.6 for watching the updated code for other versions.
Like you select the version of the Phoenix and you see tutorial accordingly the version you selected.
Anyone can clear my mind if this is possible to do it with this way?
Or anyone have tried this?
Or suggests other way to do that?
Are you talking about conditional compilation based on gettext?
No look It is just an ideia.
Like rather than you use the gettext for different idioms of languages.
You can use for example:
you have a post and the post shows you the commands for how to install something in Macos, but you click the button or select the option for install in Windows or Linux.
And then it shows you commands for the installation in which OS you prefer.
The idea is like you use to do for different idioms of languages. But in this case you will do for the different Operational Systems.
And I was thinking if it is possible to use this for write some tutorial which in a new version you need to have an update of the tutorial and with the while you need to change accordingly the version. So using this you can select the tutorial with the version you want.
It is just an idea I have and I was thinking a lot based on this lib.
I would try if my computer is great but it is broken.
So I was thinking about a lot.
I think it is a good idea.
And I am here sharing and asking if it is posible or what the people think about that…
Internationalization is already complex enough I wouldn’t overload it with even more possible axis to maintain permutations for. I’d rather look into more purpose built options for the features you think of rather than (ab)using gettext, which is just “bare strings”.
E.g. take a look at Message Format (v1 or v2) and tell me that’s not a lot to work around the constraint that you deal only with strings in internationalization.
2 Likes