HP Forums

Full Version: periodic Element Table - call for translators
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I made a program to display Periodic Element Table.
See video demonstration :
keyboard and touch screen capable.



video
keys :
arrow keys or touch screen to move
double-click or enter key to display element details.
+/- to zoom
ESC to leave

This prog is available now in 2 languages, English and French.
If you want to contribute by translating to your language, please let me know, it's quite easy, I will give details to help you.

You can download ElementsTbl here :[attachment=4366]

Let me know you comments.
Leave a comment if you can help me on translation.
Thank you.
primer
There is at least a French and English periodic table here: http://www.hpmuseum.org/forum/thread-1115.html
Hi Han,
(01-15-2017 10:27 PM)Han Wrote: [ -> ]There is at least a French and English periodic table here: http://www.hpmuseum.org/forum/thread-1115.html
yes I know...
But I built this one as being easily translatable. There are no if/then/else structure all along the program to handle only 2 languages, that would make it hardly maintable.

The program I provide is easily translatable by design, and will follow user system language. Of course it require work to fill all 118 elements and few User Interface strings, but it's grouped at grogram start.

For example, at line 49, you have each UI strings associated with a uniq ID, for example :
Code:
liq:liquid,liquide
to add a new language, one can simply add :
Code:
liq:liquid,liquide,german_word_for_liquid
and set german as 3rd language in map, line 13
Code:
local lang:={1,1,2,3,1,1,1,1}; // language mapping 1:En 2:Fr 3:Ger

I push my efforts mostly on maintenability (translation, scroll system from this template....)
My wish (if I forgot comments like "yet another one"...) is to motivate people to translate in their language. Then we could provide an element table in any user language, that would increase user experiance. Hence my post title : "call for translator".

There are also, few other small reasons why I made another program. Technically, I feel the scrolling feature from other elements apps is not perfect (a little laggy). Also, I wanted to have electron layer information (K,L,M...). State of matter is dynamical computed (that allow interresting things to be done)...

note : This is still beta version, loading time will be improved by converting translation string into its final format (the current format ease the transation addition, but it's converted at loading time, which will be avoided in the future)
If you will also consider supporting languages that the HP Prime doesn't:
My Periodic Table program includes element names in Polish (though not much else).

Whilst writing that program, I discovered a website that has the element names in all languages (My own translations are mainly a mix of that site and Google translate).
These may be useful references in checking the translations:
http://elements.vanderkrogt.net/multidict.php (many languages)
https://sciencenotes.org/element-names-d...languages/ (just a few languages)

Also, in your example code you have French as language 2...
You might consider changing that to 3 to match the HP Prime numbering.

Update: Great Video. Looks like a good and informative user interface.
Hi, nice program, but I have 2 suggestions:

1) You can use STRINGFROMID to detect the current language

2) Having independent language lists might be much less prone to errors than the big list you are using now.

Also, for example you can use AFiles("filename.ext") to save a whole language file list, instead of mixing all the languages and have them always loaded in ram:

Code:
Save:
AFiles("eng.txt"):="my text";

Load:
var:=AFiles("eng.txt")

Get available file list (to check for available languages dinamically):
listvar:=AFiles();
(01-17-2017 12:33 AM)eried Wrote: [ -> ]Hi, nice program, but I have 2 suggestions:

1) You can use STRINGFROMID to detect the current language

You can also just use the Language variable. (You can even set the language using Language:=<number>.)

Quote:2) Having independent language lists might be much less prone to errors than the big list you are using now.

Also, for example you can use AFiles("filename.ext") to save a whole language file list, instead of mixing all the languages and have them always loaded in ram:

Code:
Save:
AFiles("eng.txt"):="my text";

Load:
var:=AFiles("eng.txt")

Get available file list (to check for available languages dinamically):
listvar:=AFiles();

Great ideas. You can alternately just use file names like lang1.txt, lang2.txt, etc. This way when a user creates an app variable, you can restrict yourself to just the files named lang<number>.txt

Code:
filename:="lang" + STRING(Language,1,0) + ".txt";
langdata:=AFiles(filename);

There is a limitation to using the built-in variable Language, though (namely you are limited to what is supported in the Prime). Your program, however, can support whatever language you wish.
Reference URL's