summaryrefslogtreecommitdiff
path: root/themes/SuSE/locale.inc
diff options
context:
space:
mode:
Diffstat (limited to 'themes/SuSE/locale.inc')
-rw-r--r--themes/SuSE/locale.inc62
1 files changed, 62 insertions, 0 deletions
diff --git a/themes/SuSE/locale.inc b/themes/SuSE/locale.inc
new file mode 100644
index 0000000..d56d8a2
--- /dev/null
+++ b/themes/SuSE/locale.inc
@@ -0,0 +1,62 @@
+% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+%
+% Handle translations.
+%
+% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+
+% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+% Set language.
+%
+% ( language ) ==> ( true|false )
+%
+/setlang {
+ config.lang over eq { pop false return } if
+
+ /config.lang exch def
+
+ /help.messages .undef def
+
+ findtexts
+
+ true
+} def
+
+
+
+% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+% Find texts for current language.
+%
+% ( ) ==> ( )
+%
+/findtexts {
+ 16 string dup config.lang "texts.%s" 2 index sprintf findfile exch free
+ dup .undef eq {
+ config.lang length 2 gt {
+ pop 16 string
+ dup config.lang 1 get config.lang 0 get "texts.%c%c" 3 index sprintf findfile exch free
+ dup {
+ /config.lang 2 string
+ config.lang 1 get config.lang 0 get "%c%c" 3 index sprintf
+ def
+ } if
+ } if
+ } if
+ dup .undef eq { pop "texts.en" findfile } if
+ dup .undef eq { pop 0 cvp } if
+ cvs
+ /ft.len over cvp length def
+ /ft.str exch def
+ /ft.pos 0 def
+
+ texts {
+ ft.pos ft.str length add ft.len lt {
+ ft.str def
+ /ft.str ft.str dup length 1 add /ft.pos over ft.pos add def add def
+ } {
+ "No Texts!" def
+ } ifelse
+ } forall
+} def
+
+