Jump to content

Search the Community

Showing results for tags 'getText'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News & Announcements
    • News
  • Project Zomboid
    • PZ Updates
    • General Discussions
    • Bug Reports
    • PZ Support
    • PZ Multiplayer
    • PZ Community & Creativity
    • PZ Suggestions
  • PZ Modding
    • Tutorials & Resources
    • Mods
    • Items
    • Mapping
    • Mod Ideas and Requests
  • General Games Development
    • Indie Scene
  • Other Discussions
    • General Discussion
    • Forum Games & Activities

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Twitter


Interests

Found 1 result

  1. Hello, Yesterday i posed a question in the Modding Help section about using custom translations. http://theindiestone.com/forums/index.php/topic/3676-custom-texts-for-gettext/ Conclusion, it is not possible yet to use a translations .txt as found in the game already, but theres a option comming available soon. Now i wanted to see if i could use getText in my lua files already instead of strings so i dont have to replace them later on when this option comes available. But since a option is coming available soon i wanted to keep it simple and make it so that when the official method comes around i could easily copy paste my translation data. So the result is a very simple getText override: --***********************************************************--** TURBOTUTONE **--** Temporary custom translations fix **--***********************************************************-- set the language you want to test herelangBrev = 'EN';-- improvised translation tabletLang = {};-- English language sectiontLang['EN'] = { -- Custom context menu stuff: CtxTurboCraft_Build = "TurboCraft build", -- Add more stuff:}-- saving the original getText functionlocal old_getText = getText;-- simple getText overridegetText = function(string) -- check the offical translation function local str = old_getText(string); -- if the strings dont match its safe to assume an official translation has been found, we return if str ~= string then return str; end -- if the strings matched previously, were gonna check the improvised translation table if tLang[langBrev][string] ~= nil then return tLang[langBrev][string]; end -- if none found, return the string as is return string;endCopy paste the code to a lua file in your mod directory and add your custom translations to the translation table (tLang) and it should work the same as with the official translation, for example: getText("CtxTurboCraft_Build")Now when there comes a official method for modders available to do custom languages, then you should be able to simply copy the translation data between the brackets of the tLang table into the appropiate text file formatting and remove this temporary fix lua file. Regards, Turbo
×
×
  • Create New...