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

Not a Bug Importing core language destroys all translated add-on's phrases

Discussion in 'Resolved Bug Reports' started by Pepelac, Jan 22, 2011.

  1. Pepelac

    Pepelac Well-Known Member

    Is it a bug?
    Eg.: I've forum in russian language, and have couple of add-on, which were translated into russian in such way: I've exported all add-on phrases from ACP, translated them into russian and imported back language with overwriting. All works perfectly, but when I need to import core language again, this operation destroys all phrases. And as a result I'll need to import add-on phrases again and again.

    Here is a core language file xml example:
    <?xml version="1.0" encoding="utf-8"?>
    <language title="Russian (RU)" date_format="j M Y" time_format="H:i" decimal_point="," thousands_separator="." language_code="ru-RU">
      <phrase title="1_more_message" global_cache="0" version_id="1000017" version_string="1.0.0 Alpha 7"><![CDATA[ещё одно сообщение]]></phrase>
      <phrase title="about" global_cache="0" version_id="1000015" version_string="1.0.0 Alpha 5"><![CDATA[О себе]]></phrase>
    Romchik® likes this.
  2. Alluidh

    Alluidh Well-Known Member

    You need to split. XenForo in the language part "XenForo" (try to look at the export way) and the Add-Ons into another part of the language (for example add-on01 oder something else)

    Hope I explain it in the right words ;)
    Romchik® likes this.
  3. Pepelac

    Pepelac Well-Known Member

    So you recommend to add
    into the core language file? It could be a kind of solution, but currently there are 34 phrases (identity services and trophies) which aren't included into the XenForo add-on. And we want to have them translated too.

    BTW, there is no global_cache attribute in the RC1 language file, is it correct?
  4. Mike

    Mike XenForo Developer Staff Member

    I have no idea what the "core language" is. I'm getting the impression that you took the install/data/phrases.xml file and modified it, which really isn't ideal.

    When you export your language, you can pick the add-on to export. If you don't choose an add-on, that language will overwrite everything when imported. Otherwise, it will only overwrite phrases from the specified add-on.

    The identity services and trophies you list are "custom" phrases, so they're a challenge to handle with exports in general. You will likely have to do those manually.
    Romchik® likes this.
  5. Pepelac

    Pepelac Well-Known Member

    Hmm. No, we didn't use install/data/phrases.xml file as a base file. We have a script, which simply connects to the XF database and gets all phrases from the table. So we can do a crowd-source translation "on the fly" and after that that script creates a xml file to import. Can't remember why I've removed the addon_id attribute from the xml (maybe I did that after analyzing the xml file for import in the first beta release)...

    I've modified my translation script, now it has the addon_id attribute, going to check how it's going to work...

    What about the global_cache attribute? Do I need to add it to the xml file?
  6. Mike

    Mike XenForo Developer Staff Member

    Only when it's actually used (non-0).

    Really, you should use the existing methods to export a language - your problems are coming from not exporting in the normal way. (You're missing the addon_id on the actual phrases too.)
  7. Pepelac

    Pepelac Well-Known Member

    Ok, thanks for helping, I've modified the translation script, now it works fine. Sorry for disturbing.
  8. ragtek

    ragtek Guest

    You wanna share your script?:)
  9. Pepelac

    Pepelac Well-Known Member

    Maybe later, when I'll make it perfect [​IMG]

Share This Page