Search Unity

getting strings from .po files

Discussion in 'Scripting' started by nitrofurano, Aug 27, 2019.

  1. nitrofurano

    nitrofurano

    Joined:
    Jun 7, 2019
    Posts:
    92
    hi! do anyone know how can we get strings (for all text used in a game, for example) from .po files (localization format), from csharp scripts?
     
  2. silvematt

    silvematt

    Joined:
    Jul 15, 2016
    Posts:
    160
    You can use TextAsset to load the files and then StringReader to read every lines to then save them in a Hashtable.
    From the hashtable you will pick the value of a key.

    I've developed a little free tool to have a Multi-Language game (it uses XML but the logic is pretty much the same):
    https://forum.unity.com/threads/free-xml-multi-language-system.538357/
     
    nitrofurano likes this.
  3. nitrofurano

    nitrofurano

    Joined:
    Jun 7, 2019
    Posts:
    92