Forum > Translations
Localization of Slavic plurals?
CM630:
--- Quote from: domasz on November 08, 2024, 02:17:23 pm ---
Here's the thing- translating perfectly is super hard. So 99% companies, even Polish ones, don't care.
--- End quote ---
Well, I will reference the Polish ;D writer Stanislaw Lem: „The prevalence of the infringement cannot justify it“.
--- Quote from: ackarwow on November 08, 2024, 10:27:59 pm ---Perhaps there is another way, even less complicated: 'number of found files: %d' which in Polish can be translated as 'liczba znalezionych plików: %d'.
--- End quote ---
Thanks for the proposal, but I am not looking for an workaround (yet).
I am trying to find out if it is possible to make the things properly with Lazarus.
The wheel is already invented and specified, the question is if it is implemented in Lazarus.
TRon:
--- Quote from: CM630 on November 09, 2024, 08:24:24 pm ---I am trying to find out if it is possible to make the things properly with Lazarus.
The wheel is already invented and specified, the question is if it is implemented in Lazarus.[/size]
--- End quote ---
Yes it is possible. No it isn't already implemented (*).
There are many languages that uses different prefix and/or suffix or some alternative form of expression for different numbers.
So, while strictly speaking it is possible to add support it depends on the language. Sometimes a implemented function takes care of the difference in the English language between 1 and other numbers but I experience that as being out of the ordinary already. It is much easier to use the form: "number of files found is 0"
(*) There might be a 3th party component that is capable of automating this (and which I am not aware of). There used to be a autotranslate component for Delphi which could have done as such when extended).
Zoran:
Here is what I use in code, might be useful, albeit not be very elegant.
Not really interesting for non-slavic languages.
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function JedninaDvojinaIliMnozina(N: Integer; const SJednina, SDvojina, SMnozina: String): String; begin if N < 0 then N := -N; N := N mod 100; if (N >= 11) and (N <= 14) then N := 0; case N mod 10 of 1: Result := SJednina; 2..4: Result := SDvojina; otherwise Result := SMnozina; end;end;
Then you can use it like this (example in Serbian):
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.Prikaz(BrojProlaznika: Integer);const Poruka1: String = 'Прошао је %d човек.'; Poruka2: String = 'Прошла су %d човека.'; Poruka0: String = 'Прошло је %d људи.';begin Label1.Caption := Format(JedninaDvojinaIliMnozina(BrojProlaznika, Poruka1, Poruka2, Poruka0), [BrojProlaznika]);end;
Edit: Added small project which shows the usage.
CM630:
I was thinking about something like that as a workaround.
Just a question, please confirm that “Прошао је 21 човек.“ and “Прошао је 31 човек.” is correct? I want to be sure that it is not a software error.
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Прошло је 0 људи.Прошао је 1 човек.Прошла су 2 човека.Прошла су 3 човека.Прошла су 4 човека.Прошло је 5 људи.Прошло је 6 људи.Прошло је 7 људи.Прошло је 8 људи.Прошло је 9 људи.Прошло је 10 људи.Прошло је 11 људи.Прошло је 12 људи.Прошло је 13 људи.Прошло је 14 људи.Прошло је 15 људи.Прошло је 16 људи.Прошло је 17 људи.Прошло је 18 људи.Прошло је 19 људи.Прошло је 20 људи.Прошао је 21 човек.Прошла су 22 човека.Прошла су 23 човека.Прошла су 24 човека.Прошло је 25 људи.Прошло је 26 људи.Прошло је 27 људи.Прошло је 28 људи.Прошло је 29 људи.Прошло је 30 људи.Прошао је 31 човек.Прошла су 32 човека.
Zoran:
--- Quote from: CM630 on November 11, 2024, 11:27:50 am ---I was thinking about something like that as a workaround.
Just a question, please confirm that “Прошао је 21 човек.“ and “Прошао је 31 човек.” is correct? I want to be sure that it is not a software error.
--- End quote ---
Yes, that is correct in Serbian. But note that numbers between 11 and 14 have different rules (these act as if they don't end with 1..4)! I'm not sure if it is same in Bulgarian though.
Navigation
[0] Message Index
[#] Next page
[*] Previous page