util_launcher.lua 911 B

12345678910111213141516171819202122232425262728
  1. function releasePrint(...)
  2. if global.isGMMode then
  3. return
  4. end
  5. release_print(...)
  6. end
  7. local languageConf = {}
  8. function loadLanguageConfig( showLanguage )
  9. if showLanguage and string.len( showLanguage ) then
  10. local path = "dev/data_config/string_language.json"
  11. if cc.FileUtils:getInstance():isFileExist(path) == false then
  12. path = "data_config/string_language.json"
  13. end
  14. if cc.FileUtils:getInstance():isFileExist(path) then
  15. local jsonStr = global.FileUtilCtl:getDataFromFileEx(path)
  16. if jsonStr and jsonStr ~= "" then
  17. local cjson = require("cjson")
  18. local jsonData = cjson.decode(jsonStr)
  19. languageConf = jsonData[showLanguage] or {}
  20. end
  21. end
  22. end
  23. end
  24. function fixNewLanguageString( str )
  25. return languageConf[str] or str
  26. end