Friday Facts #244 - Localised plurals & Modernisation progress

Regular reports on Factorio development.
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by steinio »

luc wrote:Devs: you might also be interested to know that in some languages, currency is pluralized differently:

EN zero euros, one euro, two euros... (normal pluralization rules)
FR zéro euro, un euro, deux euros... (normal pluralization rules)
NL nul euro, een euro, twee euro... (always singular)
DE null euro, ein euro, zwei euro... (always singular)

There is currently no currency in the base game, but mods and the website might have it.
You are the einzigste who knows how to pluralise Euro in German. :P
Image

Transport Belt Repair Man

View unread Posts
CodeZ
Burner Inserter
Burner Inserter
Posts: 16
Joined: Wed Jun 29, 2016 1:53 pm
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by CodeZ »

As gettext was mentioned here, I'll add some points for not using it for complex tasks (and rather use something else):
  • gettext assumes, that you use English as your base "C" language. That might usually be fine, but also might not. (This seems to be more or less hard-coded, since you cannot declare non-English plural forms for base language: msgid="%d minute", msgid_plural="%d minutes" and that's it.)
  • gettext (seemingly) cannot support strings that have multiple plurals within them, thus making "5 minutes, 1 second" a difficult string to implement. It can be worked around by defining the plurals separately, but makes the containing string a mess "%1$s, %2$s". (What if "seconds" should actually be before minutes? What needs to be changed? That isn't clear from the containing string.)
Otherwise gettext is good first step for "any" software project that contains strings that are displayed to user and does its job well. And is supported widely.

For the second point above there is actually a solution defined in ICU called MessageFormat: http://userguide.icu-project.org/formatparse/messages
This allows both multiple plurals and genders within same string. Granted the format is slightly verbose, there are parsing/rendering libraries for it at least for most popular (programming) languages.

For own implementations remember, that the rules of plurals are many. Fortunately Unicode/CLDR database provides them as a web site and xml definitions (http://www.unicode.org/cldr/charts/late ... rules.html).
luc
Fast Inserter
Fast Inserter
Posts: 225
Joined: Sun Jul 17, 2016 9:53 pm
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by luc »

steinio wrote:You are the einzigste who knows how to pluralise Euro in German. :P
Danke! I will be sure to bring that up in my job interview next Wednesday, where they'll assess whether I speak enough German to be useful to them :P
Tricorius
Filter Inserter
Filter Inserter
Posts: 279
Joined: Fri Jul 01, 2016 9:04 pm
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by Tricorius »

Sanqui wrote:
thecatlover1996 wrote:Yay for not having to zoom in anymore to read the FFF on my phone! :D Next up: mobile-ready forum? ;)
I'll see what I can do ;)
Thanks so much for the responsive layout. I’d also love to see one for the forums.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by bobingabout »

whatever you do with graphics, as long as it is optimised for Windows 7, have fun. I'm still not a fan of anything released after 7. I have been playing with 10, but... it's not playing nice. (It's mostly the windows update thing that's bugging me)
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
AFD
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon May 07, 2018 2:26 pm
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by AFD »

When the 0.17 will be out?
ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by ratchetfreak »

OvermindDL1 wrote:
and in future we would like to create Vulkan and Metal backends
Oh there is no point in making a metal backend anymore, the authors of Vulkan (Khronos) made a metal/vulkan conversion library that let's vulkan run on metal (interestingly benchmarks show it to be faster than the equivalently written metal code due to optimizations the interface performs)
technically moltenVK was built by a third party and was licensable for quite a fee (aka not feasible to license for a small time dev), a year or so after that package was released as open source.
mrvn
Smart Inserter
Smart Inserter
Posts: 5848
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by mrvn »

OvermindDL1 wrote:
melind wrote:And here I thought localization of this sort of thing would have been standardized and wrapped into packages like timezones have been.

If you need, I'm fine with continuing to believe everyone speaks Czech or English. It's a fair assumption.
There are, the gettext style took over (there is a program gettext that this style came from but it is GPL, however it's been remade a hundred times at this point with better licenses, to various amounts of compliance).
While gettext, the tool, is GPL the libintl and libasprintf libraries are LGPL: https://www.gnu.org/software/gettext/ma ... enses.html

So it would be no problem to link libintl and libasprintf libraries in factorio and use gettext tools.
User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 884
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by Oktokolo »

AFD wrote:When the 0.17 will be out?
It will probably be in time for xmas 2018.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by bobingabout »

AFD wrote:When the 0.17 will be out?
Give them time, they only started on it a few weeks ago, usually they take a few months before they have an unstable to test.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
dee-
Filter Inserter
Filter Inserter
Posts: 416
Joined: Mon Jan 19, 2015 9:21 am
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by dee- »

Two words:
gettext
Vulkan
dee-
Filter Inserter
Filter Inserter
Posts: 416
Joined: Mon Jan 19, 2015 9:21 am
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by dee- »

steinio wrote:
luc wrote:Devs: you might also be interested to know that in some languages, currency is pluralized differently:

EN zero euros, one euro, two euros... (normal pluralization rules)
FR zéro euro, un euro, deux euros... (normal pluralization rules)
NL nul euro, een euro, twee euro... (always singular)
DE null euro, ein euro, zwei euro... (always singular)

There is currently no currency in the base game, but mods and the website might have it.
You are the einzigste who knows how to pluralise Euro in German. :P
btw - when you mean "a single one" don't say "einzigste" but say "einzige" as "einzige" does not have a superlative (there is nothing more singular than the singular).
The same goes for "optimal" as there is no "en: more optimal" or "de: optimalst" - it is already a superlative (there is nothing to improve on something that is already optimal).
Yes, I'm a grammar nazi. :twisted: :geek:
OvermindDL1
Fast Inserter
Fast Inserter
Posts: 193
Joined: Sun Oct 05, 2014 6:12 am
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by OvermindDL1 »

ratchetfreak wrote:
OvermindDL1 wrote:
and in future we would like to create Vulkan and Metal backends
Oh there is no point in making a metal backend anymore, the authors of Vulkan (Khronos) made a metal/vulkan conversion library that let's vulkan run on metal (interestingly benchmarks show it to be faster than the equivalently written metal code due to optimizations the interface performs)
technically moltenVK was built by a third party and was licensable for quite a fee (aka not feasible to license for a small time dev), a year or so after that package was released as open source.
Huh, when did that happen and why does it not seem to be stated on the khronos moltenvk pages? Do you have links? As I recall the license was non-revocable (apache or so).
ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by ratchetfreak »

OvermindDL1 wrote:
ratchetfreak wrote:
OvermindDL1 wrote:
and in future we would like to create Vulkan and Metal backends
Oh there is no point in making a metal backend anymore, the authors of Vulkan (Khronos) made a metal/vulkan conversion library that let's vulkan run on metal (interestingly benchmarks show it to be faster than the equivalently written metal code due to optimizations the interface performs)
technically moltenVK was built by a third party and was licensable for quite a fee (aka not feasible to license for a small time dev), a year or so after that package was released as open source.
Huh, when did that happen and why does it not seem to be stated on the khronos moltenvk pages? Do you have links? As I recall the license was non-revocable (apache or so).
https://moltengl.com/moltenvk/ though the pricing info for moltenvk there has been removed when it went open source.

From reading press releases it seems that Valve sponsored the release of moltenVK as an open source lib so that they didn't just lose that investment. They still have their other package so are not totally out of a revenue stream (and that sponsorship deal may also include a maintenance contract with moltenVK as well).
Broskev
Inserter
Inserter
Posts: 34
Joined: Sun Jan 29, 2017 8:58 pm
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by Broskev »

I fear the plural forms for Czech language are not that easy as the website would suggest. The rule should be:

everything ending with 1 except 11 = minuta
everything ending with 2-4 except 12,13,14 = minuty
everything else = minut

1 minuta
2 minuty
3 minuty
4 minuty
5 minut
6 minut
...
21 minuta
22 minuty
23 minuty
24 minuty
25 minut
...
posila
Factorio Staff
Factorio Staff
Posts: 5341
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by posila »

Broskev wrote:I fear the plural forms for Czech language are not that easy as the website would suggest. The rule should be:

everything ending with 1 except 11 = minuta
everything ending with 2-4 except 12,13,14 = minuty
everything else = minut
According to http://prirucka.ujc.cas.cz/?id=792 both forms are correct, but I don't know anybody who would say 21 minuta, 22 minuty, ...
Po složených číslovkách končících na jeden, dva, tři, čtyři jsou v 1. p. možné tvary: dvacet jeden žák i dvacet jedna žáků, dvacet dva/tři/čtyři žáci i žáků nebo jedenadvacet i jednadvacet, dvaadvacet, třiadvacet, čtyřiadvacet žáků. Mluvnická shoda mezi podmětem vyjádřeným jmennou skupinou, která obsahuje číslovky jeden, dva, tři, čtyři, a přísudkem se řídí tvarem podstatného jména v podmětu. Je-li podstatné jméno v 1. p., nastupuje shoda podle posledního členu složené číslovky (dvacet jeden žák byl…, dvacet čtyři žáci byli…). Je-li podstatné jméno ve 2. p., pak je přísudkové sloveso ve středním rodě j. č.: dvacet jedna žáků (i jedenadvacet nebo jednadvacet žáků) bylo…, dvacet čtyři žáků (i čtyřiadvacet žáků) bylo… Tvary 2. p. jsou běžnější a přirozenější.
hoho
Filter Inserter
Filter Inserter
Posts: 681
Joined: Sat Jan 18, 2014 11:23 am
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by hoho »

Omnifarious wrote:So, while DirectX probably has better performance when doing hardware rendering, it appears that OpenGL has the edge in software rendering.
Intel integrated GPUs are not quite the same as software rendering. In the CPUs that contain a GPU, the GPU part tends to take up more space than the CPU part (ignoring caches). In fact, some stuff could actually run better on an integrated GPU than a discrete one if there is lots of back and forth between the CPU and GPU - integrated has to go through local caches on same die while dedicated GPU goes through half your motherboard :)

Though having said that, I'm not really sure it makes much sense to try to optimize for a situation like yours that is effectively a software error somewhere on your OS/driver side.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by bobingabout »

dee- wrote:Two words:
gettext
Vulkan
Except where OGL and DX11 cover 99% of the audience, Vulkan is restricted to newer hardware.
I guess this excludes windows Vista users. (Only DX10 there)

Does Vulkan even work in windows 7? Because that's what I'm using, Windows 7.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
posila
Factorio Staff
Factorio Staff
Posts: 5341
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by posila »

bobingabout wrote:Except where OGL and DX11 cover 99% of the audience, Vulkan is restricted to newer hardware.
I guess this excludes windows Vista users. (Only DX10 there)

Does Vulkan even work in windows 7? Because that's what I'm using, Windows 7.
Vulkan does work on Windows 7. Windows Vista has DirectX 11 if Platform Update was installed, but if you don't have it, the game will run in OpenGL.
rldml
Fast Inserter
Fast Inserter
Posts: 180
Joined: Sun Mar 06, 2016 2:38 am
Contact:

Re: Friday Facts #244 - Localised plurals & Modernisation progress

Post by rldml »

bobingabout wrote:whatever you do with graphics, as long as it is optimised for Windows 7, have fun. I'm still not a fan of anything released after 7. I have been playing with 10, but... it's not playing nice. (It's mostly the windows update thing that's bugging me)
I don't want to scare you, but perhaps you should spend some more time in this os-stuff. Windows 7 will not get any security updates in less than two years from now (https://support.microsoft.com/en-us/hel ... fact-sheet), so you should have a working alternative before that date has come.

Alternatives to Windows 10 are actually Windows 8.1 (until 2023/01) or - of course - a Mac- or Linux-based computer.

Greetings, Ronny
Post Reply

Return to “News”