Brazilian Portuguese Translation

Discuss translation of Daggerfall Unity and the required Daggerfall installation. Help other communities learn how to translate Daggerfall using any available tools and processes.
User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Brazilian Portuguese Translation

Post by pango »

2) Genders and plural are a pain since, like you noticed, there's no provisions for such things in localization engine at the moment. Also, I guess that in brazilian, just like in french, adjectives have variants depending on the gender and plural too? So this gets worse.
French translators have either rewritten some sentences in a way that works around the issues, or simply assumed masculine gender, for lack of better solution in classic Daggerfall.
But that was before my time on Project French Daggerfall, Daneel53 can probably give details and examples.
He also worked on the localization of other games, and he told me about one (Bannerlord) that has some mechanism to support that, so I'm sure he could share that knowledge if asked. We discussed about that together in the past few weeks, but decided not to bother Interkarma with that, so close to 1.0 release. We'll probably try to implement it ourselves, if nobody beats us to it ;)

3) As Interkarma said we developed a relatively small Perl script to automate locations translation. It will read Master CSV Internal_Locations.csv from the current directory and output a french translation, along with errors if different english names were translated to the same french name ("loss of uniqueness"); I attached the current version to this post.
At the bottom of the script you'll find the list of location name patterns the script looks for. Patterns probably shouldn't need adjustments since they depend on input.
From there, it gets language-specific: production rules for each pattern, a table of names, with their genders, and a table of adjectives, with their variants depending on gender, and a few language-specific functions to adjust the two together. For example there a few adjectives ("Ancien|Doux|Vieux") that are usually placed before the name, not following the usual rule.
Some pronouns are elided in front of specific names ("le oiseau" => "l'oiseau"), I'm not sure if there's a rule about that, so this information is in names table too.
"de le" is also elided as "du", this is fixed at the last moment with a language-specific substitution, line 401.

As I said this is were it gets language specific, and you can modify that to your needs. Or find somebody with programming skills that can help you implement what you need. It's also useful to experiment a bit to avoid loss of uniqueness, and find interesting alternate translations in the process :)
Attachments
translate_locations.zip
(5.02 KiB) Downloaded 150 times
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

Magirion
Posts: 23
Joined: Mon Apr 24, 2023 4:40 pm

Re: Brazilian Portuguese Translation

Post by Magirion »

Oh hehe there's a lot to answer and ask here, but let's go. :)

First things first, thanks Karma for the hints on changing the order on the strings (I' really never noticed this), glad to say it worked. :D
Real image of me looking at code: https://tenor.com/pt-BR/view/memeblog-m ... f-18207748

Second, thanks for answering, pango. Yes genders are a pain in portuguese as well and the adjectives variate depending on genders and plural. :( On the matter of implementing the mechanic for yourselves, I want to help if I can, but I believe you've seen the gif. :)

Lastly, I have downloaded your file and man.... that's me seeing it: https://tenor.com/pt-BR/view/monkey-fac ... f-26191055 (I don't know how to put it to work and don't have any idea how code works, hehe.
I think in portuguese we don't use apostrophes to elide pronoums in front of words like in ("le oiseau" => "l'oiseau"), but we do this thing: "de le" -> "du", in our case is "de o" -> "do".

Could you please explain me how to use the script?
https://tenor.com/pt-BR/view/cute-face- ... f-26016683

Anyway, thanks everyone. :D

Magirion
Posts: 23
Joined: Mon Apr 24, 2023 4:40 pm

Re: Brazilian Portuguese Translation

Post by Magirion »

Ah, one final question :)

How do I translate the UI? I've read some of the tutorials and understanded a total of zero things. :)

Do I need Unity and Daggerfall Tools?

Just....how?

:D

Thank you all again anyway and sorry for bothering so much :)

User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Brazilian Portuguese Translation

Post by pango »

Magirion wrote: Sat Apr 29, 2023 7:56 pm Could you please explain me how to use the script?
It needs the Perl interpreter to work, under Linux it's often already installed, otherwise look for a "perl" package. Under Windows you'll need to install ActiveState Perl or Strawberry Perl.
To check if it's installed and working:

Code: Select all

$ perl -v                                                                                                                                                                        

This is perl 5, version 34, subversion 0 (v5.34.0) built for x86_64-linux-gnu-thread-multi
(with 57 registered patches, see perl -V for more detail)

Copyright 1987-2021, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
Then as I said, it'll look for the Master CSV Internal_Locations.csv from the current directory, and output a french-translated version of the same file.

In more details:
I just noticed that under Linux it expects Unix LF line-endings, so you'll to convert Internal_Locations.csv first; "flip" is convenient for that, but they're other similar tools:

Code: Select all

$ flip -bu Internal_Locations.csv
So, with Internal_Locations.csv in the current directory, (I'm using "head" just to show the first 10 lines)

Code: Select all

$ head Internal_Locations.csv
Key,Value
382613,Caarcun Manor
1435144,The Flying Goat Hostel
2484750,Ruins of The Caorchom Farmstead
3533330,Singing Star of Stendarr
4582840,The Dead Griffin Inn
5631489,Sacred Rebirth of Stendarr
6681069,Ruins of The F'igta Farmstead
7730553,Blessed Prophet of Stendarr
8779219,Maorn's Guard
translate_locations.pl will output a french version of the same file:

Code: Select all

$ perl translate_locations.pl | head
Key,Value
382613,Manoir Caarcun
1435144,L'Hôtel de la Chèvre Volante
2484750,Ruines de la Ferme Caorchom
3533330,L'Étoile Chantante de Stendarr
4582840,L'Auberge du Griffon Mort
5631489,La Renaissance Sacrée de Stendarr
6681069,Ruines de la Ferme F'igta
7730553,Le Prophète Béni de Stendarr
8779219,La Garde de Maorn
Then as I said, for your needs you won't use the translate_locations.pl script as-is, but will have to modify it, which requires to know the Perl language. Or find someone that does.
Or use a similar approach and write a script in another programming language (but Perl is quite convenient and concise for text processing).
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Brazilian Portuguese Translation

Post by Interkarma »

Magirion wrote: Sat Apr 29, 2023 7:59 pm How do I translate the UI? I've read some of the tutorials and understanded a total of zero things. :)
The UI is mostly images with text painted in. The first thing you'll need is a copy of Daggerfall Imaging 2 to export the images from your DOS gamedata. Then you'll need a paint program to redraw the text parts.

To get these in the game is mostly a matter of giving image the correct filename and dropping into StreamingAssets/Textures somewhere. This page has some more details.

Magirion
Posts: 23
Joined: Mon Apr 24, 2023 4:40 pm

Re: Brazilian Portuguese Translation

Post by Magirion »

Thanks for answering both of you :)

I tried to edit the .pl file and run it, but I don't know if an output is being generated or where it is. :/

perl is throwing this at the end: 68 collision(s)

I don't know if it's working or not. :)

User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Brazilian Portuguese Translation

Post by pango »

Magirion wrote: Sun Apr 30, 2023 1:43 am I tried to edit the .pl file and run it, but I don't know if an output is being generated or where it is. :/

perl is throwing this at the end: 68 collision(s)

I don't know if it's working or not. :)
Seems to be working, yay!

"collisions" is what I called "loss of uniqueness" before: several different english names were translated into a single name; That's bad (since it means ambiguous names are being generated), so the goal is to have 0 collisions.
The 68 lines above should display the list of english names that generate collisions, formatted as:

Code: Select all

english name #1 | english name #2 | ... => identical name they all generate
Translated output are only displayed, so if you want to save them in a file, all you need now is to redirect display into a file:

Code: Select all

$ perl translate_locations.pl > outputfilename
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

Magirion
Posts: 23
Joined: Mon Apr 24, 2023 4:40 pm

Re: Brazilian Portuguese Translation

Post by Magirion »

Thanks for answering pango. :)

It worked :D

The only things that are bothering me a bit is:

For example, the script is turning "The Old Luccta Shack" into "A Cabana de a Luccta Velha" but I think it should be "A Cabana da Velha Luccta".
The second problem as you can see, is the presence of this: "de a" and "de o" just like above and in places names like "A Taberna de o Rato e o castelo". It all should be displayed as "da" and "do", but I didn't manage to find and modify this part of the script. :/

Here is the modified .pl file: https://drive.google.com/file/d/16Q4QcD ... sp=sharing
And here is the output file using the script above: https://drive.google.com/file/d/1Sbx46d ... sp=sharing

Thank you once more. :)

User avatar
pango
Posts: 3347
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Brazilian Portuguese Translation

Post by pango »

For first problem, as I said before there's a hardcoded list of adjectives to put before the name instead of after:

Code: Select all

    if ($adj->[0] =~ /^(Ancien|Doux|Vieux)$/) {
So you should replace Vieux with Velha there. That's not great, ideally I should have made that a flag of adjectives.

For second problem, I think you should replace

Code: Select all

    $translation = "A Taberna de ".accord_nom($1)." e ".accord_nom($2) if $name =~ /^The (\w+) and (\w+) Tavern$/;
with

Code: Select all

    $translation = "A Taberna de ".accord_nom($1)." e de ".accord_nom($2) if $name =~ /^The (\w+) and (\w+) Tavern$/;
(same thing for Hostels, etc.) so the rules systematically generate the sequences "de o" and "de a";

Then next the end of the script replace

Code: Select all

    $translation =~ s/\b le /du /g;
with

Code: Select all

    $translation =~ s/\bde o /do /g;
    $translation =~ s/\bde a /da /g;
So that they're elided to do and da.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

Magirion
Posts: 23
Joined: Mon Apr 24, 2023 4:40 pm

Re: Brazilian Portuguese Translation

Post by Magirion »

Thanks for answering pango.

Following your tips I've managed to fix almost all the problems I was having, aside from the collisions and that annoying thing about the farms, shacks, etc.

I really can't make "A Cabana da Luccta Velha" become "A Velha Cabana de Luccta". :/

Any Idea how to fix this? :)

Here's the modified script: https://drive.google.com/file/d/16Q4QcD ... sp=sharing

Thank you anyway, again. :D

Post Reply