How to translate Wagic

All user created content to profit from wagic in other languages. You can post here in your original languages.
Locked
wololo
Site Admin
Posts: 3728
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

How to translate Wagic

Post by wololo »

This is a quick tutorial to translate Wagic.
Here I am talking about translating the interface and the texts on the cards, NOT the images.

Wagic supports several languages, with the following limitations:
- for Latin 1 languages, only Ascii is supported. This means you need to replace letters such as "é" into "e", or "ç" into "c", and so one
- For Non Latin 1 languages, currently only Japanese and Chinese are supported, but this is ONLY because we don't have fonts for other languages. If you are a designer/dev and can add a font to support your own language, please feel free to discuss, or ask if you need help (you need to be a bit technical savvy)

Taking these limitations into account, here is how you do that translations:

Wagic has a Res/lang folder, in which you will find several text files. Each language has 2 text files: xx.txt and xx_cards.txt. For example, fr.txt and fr_cards.txt

xx.txt contains the translations for everything, including card names and card types/subtypes, but NOT card texts. This is due to size and legacy reasons. xx_cards.txt contains the translation of the description text of cards.

Res/lang/xx.txt
the file xx.txt always starts with a comment that is actually meta data used by the Game, to display the language in the language selection menu:

Code: Select all

#LANG:Francais
In each of these files, each line is either empty, or a comment, or one translation.
Comment start with a "#"

Code: Select all

#this is a comment
Translations are always in the form

Code: Select all

english text=translated text
For example in the French translation

Code: Select all

your turn=votre tour
Res/lang/xx_cards.txt
In the cards text translation file, we use

Code: Select all

english card name=translated description text
For example:

Code: Select all

Abbey Matron={W}, {T}: La Mere abbesse gagne +0/+3 jusqu'a la fin du tour.
You can create new translation files for new languages (as long as the file starts with the #LANG:... comment, it should be taken into account), or edit existing ones if translations are missing.

How to know the english strings to translate?
If you are translating to a new language, jut take one of the existing translation files as an example.
If you are updating an existing translation, it gets more complex.
On windows, you can play the game in your language for a little while, then check Res/lang/missing.txt. This file should contain a list of the strings that are missing a translation. More "manually", you can simply play the game and see what's missing. Most of the time, the english wording is what you will want to use. This might get complex when the string is dynamically generated (for example with numbers in there...), in this case, the string to translate contains percentage symbols, etc... ("stufff %i stuff"). In that type of scenario, either use the missing.txt file, or dig in the code, or try to guess :|
Kitar
Posts: 2
Joined: Mon May 30, 2011 6:41 am

Re: How to translate Wagic

Post by Kitar »

I'm capable of translating wagic on Russian :) but I need an advice on adding new fonts. Can you give some?
Zmiulan
Posts: 8
Joined: Tue Dec 14, 2010 10:52 pm
Location: Russia, Saint-Petersburg
Contact:

Re: How to translate Wagic

Post by Zmiulan »

I've made some changes in code, that allow to use russian font just like japanese. But it was very buggy during the game, and replaces original methods for drawing symbols - that is very bad :)
I'll try to add russian fonts in next month from scratch.
bloodfiend123
Posts: 23
Joined: Wed Apr 17, 2013 11:13 am

Re: How to translate Wagic

Post by bloodfiend123 »

I can translate agic in filipino if you wanted :D. but please teach how to post a new thread
Knights & Dragons mod Fan!!!!
Luruz
Posts: 142
Joined: Sat Apr 27, 2013 12:33 am

Re: How to translate Wagic

Post by Luruz »

wololo wrote: Thu Apr 07, 2011 1:36 pm How to know the english strings to translate?
If you are translating to a new language, jut take one of the existing translation files as an example.
If you are updating an existing translation, it gets more complex.
On windows, you can play the game in your language for a little while, then check Res/lang/missing.txt. This file should contain a list of the strings that are missing a translation. More "manually", you can simply play the game and see what's missing. Most of the time, the english wording is what you will want to use. This might get complex when the string is dynamically generated (for example with numbers in there...), in this case, the string to translate contains percentage symbols, etc... ("stufff %i stuff"). In that type of scenario, either use the missing.txt file, or dig in the code, or try to guess :|
How can I access the source code to translate the game?

I have been manually translating many lines and not all are translated, as if I did not detect them because to begin with, what is in English as read in the game, when placed in the .txt file, it seems that does not recognize the same word in English .

When reading this post, I was looking for the missing.txt file but it does not appear inside the RES folder either. So I can only enter the source code to translate.

Could someone please teach me to enter? to take the original texts in English and translate them into Spanish. Thank you
mcleanross
Posts: 1
Joined: Mon Jun 27, 2022 3:55 am

Re: How to translate Wagic

Post by mcleanross »

I also changed the code to translate to Spanish but oh no it's all wrong. I have no choice but to use English!
cookie clicker
spades_online
Posts: 1
Joined: Thu Jul 07, 2022 8:46 am

Re: How to translate Wagic

Post by spades_online »

Those are the best answer. It's entirely possible to win a prize for the winner at spades online
Locked