Hello!

At the page:
?q=admin/settings/locale/language/export
I seen:
This page allows you to export Drupal strings. The first option is to export a translation so it can be shared. The second option generates a translation template, which contains all Drupal strings, but without their translations. You can use this template to start a new translation using various software packages designed for this task.

But, It isn't true!
There is not ALL string is exported. After export, the template contains too little strings for translation. Is this a bug?

At second, I don't understand one thing. Why people write additional modules and utilities for string extraction from .php files? May be, we need to make Export function is worked propertly?

Comments

dman’s picture

I suspect the issue lies in the source code of whatever you are trying to export.
Translation can only apply over strings that have been nominated to be translated by the module coder.

This means - text that was properly wrapped in a t('string') function.

Often, for various reasons (like laziness, or just not knowing about it) that doesn't happen properly to every single string in every module.

Find what the string is that's NOT getting exposed for translation export, and raise an issue (or patch) against the particular module. The fixes are trivial, but often overlooked.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

corochoone’s picture

Okay. I understood.
But, Why need export function, if it isn't work propertly? Really, Its value is zero IMHO.
Maybe, It is better solve to replace Export function with string extraction from proper module?

dman’s picture

Well, the export function exports the strings that will work.
It will not extract strings that won't work.

If you had some other string extraction method - that you could be sure wouldn't also extract every single quoted thing found in the code - you may end up with more strings to translate...
... but those strings would never be used in the page again because they were not wrapped with t() in the first place. If it wasn't exported, it won't be imported again.
So the value of that approach would be zero.

The job the translation module does is not just string replacement. It can only apply to full words and sentences the module designer has declared will be displayed to the user. There are many more internal strings in modules that are not supposed to be translated. Translating them would break things. It also does other magic with placeholders and things.

You don't have to use the export module I guess, if you think you have a better way. But only t() strings will get translated back, so you have to find and translate only the t() strings.
It's very common that people trying to do a translation will notice somewhere that wasn't done quite properly, and will submit a report for the module.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

corochoone’s picture

I don't understand again.

dman:If you had some other string extraction method - that you could be sure wouldn't also extract every single quoted thing found in the code - you may end up with more strings to translate...
... but those strings would never be used in the page again because they were not wrapped with t() in the first place. If it wasn't exported, it won't be imported again.
So the value of that approach would be zero.

If this really fact, why people uses extract function?
And explain me please such thing. After export and translation, .po file has 150kb size. After import, only PART of interface will be translated. But, Russian translation .po file, for example, has 540kb size. And after import it, ALL interface will be translated. If that you talking above is true, then after import the Russian file, interface would be translated partially too, because t() (as you talking) is not used everywhere. I don't understand.

corochoone’s picture

I tried last Drupal6 release candidate. The problem was not solved and I see, nobody want no to solve it.
I see, nobody not think, that it is a problem.
I'm sad. :(
After release Drupal6, there will be unusable function - export translation.
People will be ask similar questions again and again. :(