Language pack support.
While maintaining Hyprdots, someone ask me about these. Then someone asked me in HyDE too. Both issues where closed as we are only using bash and at that time it is hard to maintain! Now I kinda felt we can extend HyDE thanks to its modularity.
Recently, I came up with an idea that I think will work and doesn't break the existing scripts we have.
As of the moment I implemented translations for shaders and screenshot commands, both written with bash.
For Python it is built in so no problem with that.
How to contribute:
So here's some points we need to address.
Translating Bash's scripts notification output
Basically we will use bash's associative array. A locale file will be added eg xdg_config_home/hyde/locale/en.sh
then translations are declared by using associative arrays
declare -A _T
_T["Error"]="Wrong? lol"
_T["Shader:"]="😎"
_T["Shader reloaded:"]="yeah it reloads"
this will be sourced with bash without any drawback in execution speed!
I already added the l10n.sh when sourced injects the new send_notifs and print_log functions this triggers the translations without any perf cost.
Using Python
I don't know yet but I think it is easy lol.
Other Hardcoded Guis
That sucks but we can still kinda do it. That's why we call it language packs.
Just like themes that we externally inject to the configs.
What I have in mind --
keybindings.conf
This is PITA 🫓, however we have 2 options
.
- provide translated keybindings.conf in the language pack. Simple as that, then will be added as a post install hook
- The binds Are displayed using the python script so we can translate it on the go. However It assumes original keybinding.conf will not change. So I suggest to use option 1.
waybar modules
This is already posible! Modules are override-able so anyone can make a translation , put it in the language pack and inject it later!
Other config base guis
Yeah same as above
So for the Challenges that we might encounter, is we don't have a good config installer/restorer/injector that can cleanly uninstall those configs. Yes we can Install it to your config but how to remove it!
We have existing options but it breaks HyDE. Let's see if we can (continue to) make one.
Language pack support.
While maintaining Hyprdots, someone ask me about these. Then someone asked me in HyDE too. Both issues where closed as we are only using bash and at that time it is hard to maintain! Now I kinda felt we can extend HyDE thanks to its modularity.
Recently, I came up with an idea that I think will work and doesn't break the existing scripts we have.
As of the moment I implemented translations for shaders and screenshot commands, both written with bash.
For Python it is built in so no problem with that.
How to contribute:
So here's some points we need to address.
Translating Bash's scripts notification output
Basically we will use bash's associative array. A locale file will be added eg
xdg_config_home/hyde/locale/en.shthen translations are declared by using associative arrays
this will be sourced with bash without any drawback in execution speed!
I already added the
l10n.shwhen sourced injects the new send_notifs and print_log functions this triggers the translations without any perf cost.Using Python
I don't know yet but I think it is easy lol.
Other Hardcoded Guis
That sucks but we can still kinda do it. That's why we call it language packs.
Just like themes that we externally inject to the configs.
What I have in mind --
keybindings.conf
This is PITA 🫓, however we have 2 options
.
waybar modules
This is already posible! Modules are override-able so anyone can make a translation , put it in the language pack and inject it later!
Other config base guis
Yeah same as above
So for the Challenges that we might encounter, is we don't have a good config installer/restorer/injector that can cleanly uninstall those configs. Yes we can Install it to your config but how to remove it!
We have existing options but it breaks HyDE. Let's see if we can (continue to) make one.