Skip to content
Chris Petersen edited this page Oct 16, 2014 · 2 revisions

local-get-text gets the text in the given language for the str key. The source of this language comes from the csv file loaded by (local-load fname) and which language is used is set by (local-index-set! index).

Parameter Description
str The string that is a key for the text to get in the current language.

Example

Example: The csv file below is loaded and the index is set and then some files are outputted before the index is set to something new and more text outputted.

File localization.csv
hi,Hello,Bonjour
bye,Goodbye,Au revoir

./DemoConsole 
>(local-load "localization.csv") 
>(local-index-set! 2)
>(local-get-text "hi")
"Bonjour"
>(local-get-text "bye")
"Au revoir"
>(local-index-set! 1)
>(local-get-text "hi")
"Hello"
>(local-get-text "bye")
"Goodbye"
Clone this wiki locally