using yoshi to set language preferences - Printable Version +- yab | yet another Basic for HAIKU (https://yab.orgfree.com/forum) +-- Forum: General discussion (https://yab.orgfree.com/forum/forumdisplay.php?fid=8) +--- Forum: yoshi (https://yab.orgfree.com/forum/forumdisplay.php?fid=12) +--- Thread: using yoshi to set language preferences (/showthread.php?tid=74) |
using yoshi to set language preferences - clasqm - 10-11-2016 I just ported a Java app called GoGrinder, which lets you explore Go (the board game) problems. In the documentation it says To set GoGrinder to use a specific language, you can run it once using the defaultLanguage option: java -jar GoGrinder.jar defaultLanguage=fr GoGrinder will remember this setting in future sessions. Currently supported languages and codes: English - en Czech - cz German - de Spanish - es French - fr Portuguese - pt Russian - ru Chinese - zh So how do we write this into a little preferences applet? No problem. In the apps directory I created a yoshi file: Code: *.title = Change GoGrinder UI language and a bash script Code: #!/boot/system/bin/bash I thought of doing radiobuttons at first but you only get six of those to play with and I needed eight. One case where this will fall flat is if yoshi is installed in ~/config instead of /boot/system. I'll see if I get around to fixing that - not fond of disjunctions in bash. So now all I need to do is to stick an icon onto that script and link it to the Preferences section of the Deskbar. Total disk usage just over a kilobyte. I yoshi! RE: using yoshi to set language preferences - bbjimmy - 10-11-2016 Nice! replace if [ ! -f /bin/yoshi ]; then wirh if [ ! -f /bin/yoshi ] && [ ! -f ~/config/bin/yoshi ]; then |