Nuno Lopes wrote:
+/* Checks if translated file is updated */
+if ($lang != 'en' && !isset($using_fallback)) {
+
+ if (preg_match('$Revision: 1.88 $', $file_revision, $matches)) {

$Revision 1.88 exactly?


Fixed in the source. CVS has replaced my rexesp automatically.



+ $lang_rev = $matches[1];
+ } else {
+ $lang_rev = 0;
+ }
+
+ /* get english file revision */
+ $data = @file_get_contents(FALLBACK_BASE . $filename);
+ if (preg_match('/<!-- .Revision: \d+\.(\d+) . -->/', $data, $matches))

{


+ $en_rev = $matches[1];
+ } else {
+ $en_rev = 0;
+ }

The English file revision should be extracted from the $Revision value. The English revision corresponding to the translated file should be extracted from the EN-Revision header in the translated file. Your extractions are not really doing this.

Goba


I think there is no $Revision var. livedocs has a variable, $file_revision
that is the language revision. Then I open the english file and fetch the en
revision.
Whats wrong here?

You don't seem to be aware fo the EN-Revision tag used by translators:


http://www.php.net/manual/howto/translation-revtrack.html (9.4.2)

Let's take an example with the french documentation : We can't know if a file is not up to date by comparing the $Revision tag for both "fr/foo.xml" and "en/foo.xml"

Scenario :

en/foo.xml is added (en : 1.1)
fr/foo.xml is translated (fr : 1.1)
en/foo.xml is updated (en : 1.2)

there was a typo in the french translation, I corrected it and commited my change, but I didn't updated the file to match the last english version :

fr/foo.xml (1.2)

with your script, you think that fr is up to date :(
That's why you have to compare the <!-- $Revision --> tag in the english file with the <!-- EN-Revision --> tag in the french file.


I'll take care of corecting your hack if you want, as I'm much familiar with the Revision tracking tag.

didou

Reply via email to