Translation of tags into Russian

Started by IWTA, June 28, 2019, 09:37:04 AM

Previous topic - Next topic

IWTA

Write to me, please, as a person who has never dealt with programming, as far as possible in more detail how to do everything.

I have:
1) Installed in the folder: C:\PERL\ - strawberry-perl-5.30.0.1-64bit.msi.
2) Downloaded Image-ExifTool-11.54.tar.gz which I unpacked along the path: C:\ExifTool\
3) There is an edited out.xml file which I do not know where to put in order to get ru.pm on the output
4) There is a import.pl created by me with the code:

push @INC, 'lib';
    require Image::ExifTool::TagInfoXML;
    my $file = shift or die "Expected XML file name\n";
    $Image::ExifTool::TagInfoXML::makeMissing = shift;
    Image::ExifTool::TagInfoXML::BuildLangModules($file,8);


Do I need to change something in this code? If so, what to edit? And where should I put this import.pl file?



5) There is a command: perl import.pl out.xml ru which I do not know where to enter.

"Give me a discount"  :)  for incompetence in this matter. Explain to me "intelligibly" how this is done.

=============

Oliver
In your version it looks kind of simpler, but I don't know where to put out.xml and import.pl files
I do not know what and how to run to use the commands:

perl_orig exiftool.pl -listx -exif:all > out.xml
perl_orig.exe import.pl out.xml ru

obetz

Quote from: IWTA on July 04, 2019, 04:58:52 AM
Oliver
In your version it looks kind of simpler, but I don't know where to put out.xml and import.pl files
I do not know what and how to run to use the commands:

perl_orig exiftool.pl -listx -exif:all > out.xml
perl_orig.exe import.pl out.xml ru


Put the import.pl file in the exiftool_files folder created by my installer.

Open a command prompt or PowerShell window in the "exiftool_files" folder. Do you know how to do so? I can try to write some guidance if you need.

As soon as "exiftool_files" is your current directory in the command window, execute the two commands:

perl_orig exiftool.pl -listx -exif:all > out.xml
perl_orig.exe import.pl out.xml ru


this will create out.xml in the"exiftool_files" directory.

The thing to understand is that "plain perl" is started from the "exiftool_files" directory, but the simplified "exiftool.exe" launcher is one level earlier.

Oliver

IWTA

Oliver
Thank you very much! Now it all worked "like a watch"!   8)

IWTA

Quote from: Phil Harvey on July 03, 2019, 07:35:17 AM
6. Edit the generated language module lib/Image/ExifTool/Lang/ru.pm, and
search and replace all 'MISSING' strings in the file with your translations
Phil.
Is it possible to edit import.pl so that for untranslated tags there is no translation added with the word "MISSING"?
The name of MANY tags should not be translated, and I deliberately do not translate them into Russian, but this script still automatically adds the translation MISSING to the untranslated tags. And then I have to manually search for them and delete all the lines that have the word MISSING.
I am translating using ETTrans.exe and I do not need this function. It only bothers me.

Phil Harvey

Yes, just change BuildLangModules($file,8); to BuildLangModules($file);.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

IWTA

Unfortunately it does not work!  :(
Untranslated strings are still added with the MISSING translation.
Here is the contents of the edited import.pl file:
push @INC, 'lib';
    require Image::ExifTool::TagInfoXML;
    my $file = shift or die "Expected XML file name\n";
    $Image::ExifTool::TagInfoXML::makeMissing = shift;
    Image::ExifTool::TagInfoXML::BuildLangModules($file);

Phil Harvey

Sorry, I was going by my faulty memory.  The "8" flag was to override existing descriptions.

To avoid the MISSING entries, just run the script with a single argument (ie. "import.pl test.xml")

I have tested this now, and it works for me.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

IWTA

I use the assembly proposed by Oliver.
If I understand you correctly, I should not change the import.pl file. Yes?

To run the script, I created a .cmd file with the command:
perl_orig.exe import.pl out.xml ru

Now, if I understand correctly, do I need to remove the last RU from this command? The result is a command:
perl_orig.exe import.pl out.xml

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

IWTA

Please write in more detail how the import of the translation of tags with this parameter will occur: ($file,8) and here with this: ($file)?

Phil Harvey

If a description in the XML file is different from the language module (.pm file), then it won't be imported unless bit 3 (0x08) is set in the second argument to BuildLangModules().  There are other bits that may be set too:

#       0x01 = preserve version numbers
#       0x02 = update all modules, even if they didn't change
#       0x04 = update from scratch, ignoring existing definitions
#       0x08 = override existing different descriptions and values


- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

IWTA

The Padding tag in the FLAC section has a different meaning than in other sections. You need to rename it so that you can make different translations for the tag of the same name.

Phil Harvey

This tag is marked as Unknown, so it isn't even extracted under normal circumstances.  I don't think it is worth worrying about this translation.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Jom

Where can I read about how to translate?

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).