• 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

Pepelac

Well-known member
#1
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:
Code:
<?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>
 

Alluidh

Well-known member
#2
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 ;)
 

Pepelac

Well-known member
#3
So you recommend to add
Code:
addon_id="XenForo"
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?
 

Mike

XenForo developer
Staff member
#4
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.
 

Pepelac

Well-known member
#5
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?
 

Mike

XenForo developer
Staff member
#6
What about the global_cache attribute? Do I need to add it to the xml file?
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.)