Fonts after gettextization

Discuss and coordinate development of mainline and user-made content translations.

Moderator: Forum Moderators

yeti
Posts: 93
Joined: June 22nd, 2004, 4:56 pm
Location: Brno, Czech Republic
Contact:

Fonts after gettextization

Post by yeti »

How do I make Czech characters work? In .cfg files, East-European languages used to set

Code: Select all

font="Bepa-Roman.ttf"
But po files have no such facility, and thus I see empty squares instead of some characters in BfW now, namely ů and ř. It uses Vera font.

Ideally, a suitable font would be selected by BfW, based on the language.
User avatar
Viliam
Translator
Posts: 1341
Joined: January 30th, 2004, 11:07 am
Location: Bratislava, Slovakia
Contact:

Re: Fonts after gettextization

Post by Viliam »

IMHO there is no substantial difference between CFG and PO files. Both are just a set of key - value pairs, only formatted differently.

CFG files used fake keys -- language, id, encoding and font -- which were not to be translated, but provided special values. We could use the similar system in PO files; except that encoding is no longer needed since we switched everything to UTF-8 format, and id is obvious from the file name. I am not sure about the language key; I do not know how difficult/slow it would be to open all PO files, just to get the names of languages for the "choose language" dialog.

We can continue to use a key "font" to mean font file used by the language. Or perhaps we could rename it to "$font" or something like that, to make clear that this is a special value, which is to be treated specially.
yeti
Posts: 93
Joined: June 22nd, 2004, 4:56 pm
Location: Brno, Czech Republic
Contact:

Re: Fonts after gettextization

Post by yeti »

Viliam wrote:IMHO there is no substantial difference between CFG and PO files.
PO files are more or less key-value pairs. CFG files are WML, though I'm not sure what of it could be meaningfully used in translation files.
Viliam wrote:We can continue to use a key "font" to mean font file used by the language. Or perhaps we could rename it to "$font" or something like that, to make clear that this is a special value, which is to be treated specially.
We could, if there was a string in the sources specifying the font and marked as translatable, which isn't ATM.

Anyway, I would prefer if either (a) a font suitable for all languages was used by default -- or at least all languages using latin alphabet, this is IMHO not too much to ask (b) BfW chose a good font itself, as the set of character needed to display given language (+ original text for yet untranslated stuff) is known.
User avatar
Viliam
Translator
Posts: 1341
Joined: January 30th, 2004, 11:07 am
Location: Bratislava, Slovakia
Contact:

Re: Fonts after gettextization

Post by Viliam »

yeti wrote:PO files are more or less key-value pairs. CFG files are WML, though I'm not sure what of it could be meaningfully used in translation files.
In theory, it is possible in CFG files to define constants, macros, etc. In practice, when I look into "data/translations" directory, no one has used this. The only used features of CFG files are key-value pairs and comments.

yeti wrote:We could, if there was a string in the sources specifying the font and marked as translatable, which isn't ATM.
Do other CFG files qualify as sources too? Probably yes, otherwise it would not be possible to translate scenario dialogs. Then, we only need to define a file called "dummy.cfg", which will include special strings (perhaps also with some comment about what they mean).

yeti wrote:Anyway, I would prefer if either (a) a font suitable for all languages was used by default -- or at least all languages using latin alphabet, this is IMHO not too much to ask (b) BfW chose a good font itself, as the set of character needed to display given language (+ original text for yet untranslated stuff) is known.
Font for all languages (including those not added yet) is not possible - think about "tengwar" or other very special alphabets.

All currently used languages are probably supported by font Bepa (which is an extension to original Vera).
sanna
Posts: 425
Joined: June 5th, 2004, 9:59 am
Location: Halmstad, Sweden

Re: Fonts after gettextization

Post by sanna »

Viliam wrote:In theory, it is possible in CFG files to define constants, macros, etc. In practice, when I look into "data/translations" directory, no one has used this. The only used features of CFG files are key-value pairs and comments.
data/translations/swedish.cfg wrote:

Code: Select all

...
#define SWEDISH_BoW
Striden om Wesnoth#enddef
#define SWEDISH_CHAOTIC
kaotisk#enddef
#define SWEDISH_CHAOTIC_CAP
Kaotisk#enddef
#define SWEDISH_COMMANDER
kommendör#enddef
#define SWEDISH_COMMANDER_CAP
...
I use defines extensively, and am still unsure whether or not I need to change this manuallly. :(
yeti
Posts: 93
Joined: June 22nd, 2004, 4:56 pm
Location: Brno, Czech Republic
Contact:

Re: Fonts after gettextization

Post by yeti »

Viliam wrote:Do other CFG files qualify as sources too? Probably yes, otherwise it would not be possible to translate scenario dialogs. Then, we only need to define a file called "dummy.cfg", which will include special strings (perhaps also with some comment about what they mean).
I don't really care if it's in .cpp sources, .cfg files, or whatever. The point I'm trying to make is that is not anywhere now and thus Czech is b0rken.
Viliam wrote:Font for all languages (including those not added yet) is not possible - think about "tengwar" or other very special alphabets.
Something told me mentioning `all languages' would inevitably bring either tengwar or klingon... ;-)
Viliam wrote:All currently used languages are probably supported by font Bepa (which is an extension to original Vera).
Well, then why does BfW use normal Vera by default? If the solution is so simple, then this question should be probably asked elsewhere, as devs don't read this forum much...

P.S.: I didn't realize Bepa is a really clever pun on Vera, until you put them side by side :-)
yeti
Posts: 93
Joined: June 22nd, 2004, 4:56 pm
Location: Brno, Czech Republic
Contact:

Re: Fonts after gettextization

Post by yeti »

yeti wrote:Well, then why does BfW use normal Vera by default? If the solution is so simple, then this question should be probably asked elsewhere, as devs don't read this forum much...
Oops, I should have read http://www.wesnoth.org/forum/viewtopic.php?t=964 first. So is there any problem with replacing Vera with Bepa altogether?
User avatar
Viliam
Translator
Posts: 1341
Joined: January 30th, 2004, 11:07 am
Location: Bratislava, Slovakia
Contact:

Re: Fonts after gettextization

Post by Viliam »

sanna wrote:I use defines extensively, and am still unsure whether or not I need to change this manuallly. :(
Oops, my apologies, I missed that one translation. Bad news - I am afraid (though not 100% sure) that such use of macros is incompatible with gettext.

yeti wrote:Something told me mentioning `all languages' would inevitably bring either tengwar or klingon... ;-)
Only to make the point clearer. I could have used Chinese probably as well. There are few nice free fonts. One if very lucky to find any supporting "central European" characters. I do not know what is the situation like with Chinese / Japanese / Korean free fonts. But I feel like searching for a nice free font supporting both CE and CJK characters would be too much of a miracle to happen before version 1.0 is ready.

(So far I haven't seen any Chinese or Japanese translator here, but I believe that sooner or later they will come. Or maybe Hebrew or Arabic... simply, someone using characters outside Latin and Cyrilic groups.)

yeti wrote:So is there any problem with replacing Vera with Bepa altogether?
Personally, I do not see any problem. The only thing that prevents me from screaming "Replace all fonts with Bepa, NOW!" is looking at the fonts' file sizes. Vera has 6KB, Bepa 46KB... assuming that Bepa covers all Vera range, and a few characters more, it's kind of suspicious. If someone only could explain it to me, because I do not understand the TTF format...
User avatar
Viliam
Translator
Posts: 1341
Joined: January 30th, 2004, 11:07 am
Location: Bratislava, Slovakia
Contact:

Re: Fonts after gettextization

Post by Viliam »

Viliam wrote:...Vera has 6KB, Bepa 46KB...
:oops: should be: Vera - 66, Bepa - 46, of course
sanna
Posts: 425
Joined: June 5th, 2004, 9:59 am
Location: Halmstad, Sweden

Re: Fonts after gettextization

Post by sanna »

Viliam wrote:Oops, my apologies, I missed that one translation. Bad news - I am afraid (though not 100% sure) that such use of macros is incompatible with gettext.
Very bad news indeed, since the amount of texts to be translated is so large, it's almost inevitable that we'll end up with a lot of inconsistencies in the translation of 'special terms' if defines cannot be used. :(
yeti
Posts: 93
Joined: June 22nd, 2004, 4:56 pm
Location: Brno, Czech Republic
Contact:

Re: Fonts after gettextization

Post by yeti »

sanna wrote:Very bad news indeed, since the amount of texts to be translated is so large, it's almost inevitable that we'll end up with a lot of inconsistencies in the translation of 'special terms' if defines cannot be used. :(
Maybe you could use M4 preprocessing, if you really like macros. At least privately, it might be overkill in BfW itself. Though this defeats the idea of having primary sources in CVS.

Or take it easy ... there are laguages (like mine) with declension and conjugation complex enough to prevent anyone from even thinking of macros.
yeti
Posts: 93
Joined: June 22nd, 2004, 4:56 pm
Location: Brno, Czech Republic
Contact:

Re: Fonts after gettextization

Post by yeti »

(deleted duplicate)
sanna
Posts: 425
Joined: June 5th, 2004, 9:59 am
Location: Halmstad, Sweden

Re: Fonts after gettextization

Post by sanna »

yeti wrote:if you really like macros
I only started to use them because...
Wesnoth Translations WIKI ([url]http://wesnoth.slack.it/?WesnothTranslations[/url]) wrote:A good tip to all translators is to use defines to keep the skills and such constant during diffrent iterations of the game.
I continued to use them primarily for translations that I was not altogether happy with, in order to easily be able to change them when a better translation presented itself.
yeti wrote:Or take it easy ... there are laguages (like mine) with declension and conjugation complex enough to prevent anyone from even thinking of macros.
Yes, I know that there are many languages where using macros would be more complicated than 'manually' keeping the translations consistent.
Well, at least I know now that I have to replace them. :wink:
So I'll just go and take a stab at replacing the defines with literal text!
miyo
Posts: 2201
Joined: August 19th, 2003, 4:28 pm
Location: Finland

Post by miyo »

"Languages that need a different font than the default ''Vera.ttf'' must declare it by translating the ''"Vera.ttf"''
string into the correct filename." -- http://wesnoth.slack.it/?GetText

- Miyo
Last edited by miyo on August 29th, 2004, 3:56 pm, edited 1 time in total.
sanna
Posts: 425
Joined: June 5th, 2004, 9:59 am
Location: Halmstad, Sweden

Post by sanna »

miyo wrote:"Languages that need a different font than the default ''Vera.ttf'' must declare it by translating the ''"Vera.ttf"''
string into the correct filename." -- http://wesnoth.slack.it/GetText
Hm that should be http://wesnoth.slack.it/?GetText right? Nice to see that they've edited the WIKI to include this vital info. :)
Post Reply