r438 - in trunk: . scripts

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Jan 19 21:11:01 EST 2008


Author: icculus
Date: 2008-01-19 21:11:01 -0500 (Sat, 19 Jan 2008)
New Revision: 438

Modified:
   trunk/lua_glue.c
   trunk/scripts/localization.lua
   trunk/scripts/mojosetup_init.lua
Log:
Split out internal strings and app-specific strings, so package developers
 don't have to track our changes to keep their localizations up to date.


Modified: trunk/lua_glue.c
===================================================================
--- trunk/lua_glue.c	2008-01-19 22:19:14 UTC (rev 437)
+++ trunk/lua_glue.c	2008-01-20 02:11:01 UTC (rev 438)
@@ -1620,8 +1620,9 @@
     free(binarypath);
     free(homedir);
 
-    // Set up localization table, if possible.
+    // Set up localization tables, if possible.
     MojoLua_runFile("localization");
+    MojoLua_runFile("app_localization");
 
     // Transfer control to Lua to setup some APIs and state...
     if (!MojoLua_runFile("mojosetup_init"))

Modified: trunk/scripts/localization.lua
===================================================================
--- trunk/scripts/localization.lua	2008-01-19 22:19:14 UTC (rev 437)
+++ trunk/scripts/localization.lua	2008-01-20 02:11:01 UTC (rev 438)
@@ -6,6 +6,10 @@
 
 -- Lines starting with "--" are comments in this file.
 --
+-- You should add your installer's strings to app_localization.lua, not this
+--  file. This file is for strings internal to MojoSetup, and we change it all
+--  the time. Your app can override any individual string in this file, though.
+--
 -- NOTE: If you care about Unicode or ASCII chars above 127, this file _MUST_
 --  be UTF-8 encoded! If you think you're using a certain high-ascii codepage,
 --  you're wrong!

Modified: trunk/scripts/mojosetup_init.lua
===================================================================
--- trunk/scripts/mojosetup_init.lua	2008-01-19 22:19:14 UTC (rev 437)
+++ trunk/scripts/mojosetup_init.lua	2008-01-20 02:11:01 UTC (rev 438)
@@ -130,6 +130,21 @@
     MojoSetup.localization = nil
 end
 
+-- Merge the applocalization table into localization.
+if type(MojoSetup.applocalization) == "table" then
+    for k,v in pairs(MojoSetup.applocalization) do
+        if MojoSetup.localization[k] == nil then
+            MojoSetup.localization[k] = v  -- just take the whole table as-is.
+        else
+            -- This can add or overwrite entries...
+            for lang,str in pairs(MojoSetup.applocalization) do
+                MojoSetup.localization[k][lang] = str
+            end
+        end
+    end
+end
+MojoSetup.applocalization = nil  -- done with this; garbage collect it.
+
 -- Map some legacy language identifiers into updated equivalents.
 local lang_remap =
 {




More information about the mojosetup-commits mailing list