1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to make a language XML file

Discussion in 'XenForo Questions and Support' started by Weiyan, Dec 5, 2010.

  1. Weiyan

    Weiyan Well-Known Member

    How to make an XML file with all the phases for easier translation.

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <language title="繁體中文" date_format="j/n/y" time_format="g:i A" decimal_point="." thousands_separator=",">
      <phrase title="about" addon_id="XenForo" global_cache="0" version_id="1000034" version_string="1.0.0 Beta 4"><![CDATA[關於]]></phrase>
    </language>
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I don't know of a built in option to generate a language XML file for the purpose of translation.

    This file contains all of the phrases:

    install/data/phrases.xml

    But you can't use this file directly for translations because it's not in the format of a language file. Perhaps you can edit the file to change it into a workable format.
     
    Weiyan likes this.
  3. ragtek

    ragtek Guest

    You can create a new language in your acp;)
     

    Attached Files:

    Weiyan likes this.
  4. Weiyan

    Weiyan Well-Known Member

    I see. I need a new language file with all untranslated phrases for the sake of easier translation.
     
  5. Weiyan

    Weiyan Well-Known Member

    The phrases in language file is:
    HTML:
    ?xml version="1.0" encoding="utf-8"?>
    <language title="繁體中文" date_format="j/n/y" time_format="g:i A" decimal_point="." thousands_separator=",">
      <phrase title="about" addon_id="XenForo" global_cache="0" version_id="1000034" version_string="1.0.0 Beta 4"><![CDATA[關於]]></phrase>
      <phrase title="about_you" addon_id="XenForo" global_cache="0" version_id="1000034" version_string="1.0.0 Beta 4"><![CDATA[自我介紹]]></phrase>
      <phrase title="accepted_file_types" addon_id="XenForo" global_cache="0" version_id="1000034" version_string="1.0.0 Beta 4"><![CDATA[可接受的檔案類型]]></phrase>
    </language>
    Phrases in phrases.xml is:
    HTML:
    <?xml version="1.0" encoding="utf-8"?>
    <phrases>
      <phrase title="about" global_cache="0" version_id="1000015" version_string="1.0.0 Alpha 5"><![CDATA[About]]></phrase>
      <phrase title="about_you" global_cache="0" version_id="1000015" version_string="1.0.0 Alpha 5"><![CDATA[About You]]></phrase>
      <phrase title="accepted_file_types" global_cache="0" version_id="1000011" version_string="1.0.0 Alpha 1"><![CDATA[Accepted file types]]></phrase>
    <hrases>
    The parameters are not the same. Simple copy and paste cannot solve the problem.
     
  6. beduino

    beduino Active Member

    Hi Weiyan,
    I already look for this answer ... without success.
    The best way [I think ... ] is use your phrases.xml , translate and copy/paste to your language xml.

    The language xml have
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <language title="blabla" date_format="j F Y" time_format="g:i A" decimal_point="." thousands_separator=",">
    And phrases have, only
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    
    But I don't know if this is the right way. In language xml we find [example]
    Code:
    <phrase title="1_more_message" addon_id="XenForo" global_cache="0" version_id="1000032" version_string="1.0.0 Beta 2"><![CDATA[1 msg a mais]]></phrase>
    
    I don't know if we need include this [addon_id="XenForo"] in all lines :confused:

    All the best
     
  7. Weiyan

    Weiyan Well-Known Member

    Thank you. The parameters in phrases.xml is not the same as in the language.xml.
    I started translation, using the stupid way.
     
  8. beduino

    beduino Active Member

    Yes, not the same. You know if we need include the addon_id later?
    thank you
    in time: 'stupid way'?
     
  9. Weiyan

    Weiyan Well-Known Member

    I guess there is addons' phrases, so addon id needed.
    I use the admin cp's appearance>language>phrases.
    Running working xf on xampp, its fast enough.
    Another guy has started chinese translation, he direct translate xml file, for many months. I think the smart method is dead.
     

Share This Page