Coder Social home page Coder Social logo

Comments (9)

MichaelDvP avatar MichaelDvP commented on June 20, 2024 1

The plurals here have 5 fields, but full spec is 6 fields {{zero, one, two, few, many, other}}, see https://github.com/ivanhofer/typesafe-i18n/tree/main/packages/runtime#plural
But not all are used, language specific it is matched to fewer cases: https://www.unicode.org/cldr/charts/43/supplemental/language_plural_rules.html
For sk we have {{one, few, may, others}}, with few matches 2-4, many matches flowts and others matches 0 and 5-up
Please check with 4 cases or use all 6.

Tested: 4 does not work, we have to use all 6 cases. As we have only int numbers, the many does not matter here, we have only to add the other for 5 and up.

  NUM_DEVICES: '{num} Zariaden{{í|ie|ia|ia|í|í}}',
  NUM_TEMP_SENSORS: '{num} Teplotn{{ých|ý|é|é|ých|ých}} sníma{{čov|č|če|če|čov|čov}}',
  NUM_ANALOG_SENSORS: '{num} Analogov{{ých|ý|é|é|ých|ých}} sníma{{čov|č|če|če|čov|čov}}',
  NUM_DAYS: '{num} d{{ní|eň|ní|ní|ní|ní}}',
  NUM_SECONDS: '{num} sek{{únd|unda|undy|undy|únd|únd}}',
  NUM_HOURS: '{num} hod{{ín|ina|iny|iny|ín|ín}}',
  NUM_MINUTES: '{num} minú{{t|ta|ty|ty|t|t}}',

grafik

from ems-esp32.

SoftVienka avatar SoftVienka commented on June 20, 2024 1

Good work.
Embedded. index.ts.SK2.txt

from ems-esp32.

MichaelDvP avatar MichaelDvP commented on June 20, 2024

Seems the new pluralization here:

NUM_DEVICES: '{num} Zariaden{{í|ie|ia|ia|í}}',
NUM_TEMP_SENSORS: '{num} Teplotn{{ých|ý|é|é|ých}} snímač{{ov||e|e|ov}}',
NUM_ANALOG_SENSORS: '{num} Analogov{ých|ý|é|é|ých}} snímač{{ov||e|e|ov}}',
NUM_DAYS: '{num} d{{ní|eň|ní|ní|ní}}',
NUM_SECONDS: '{num} sek{{únd|unda|undy|undy|únd}}',
NUM_HOURS: '{num} hod{{ín|ina|iny|iny|ín}}',
NUM_MINUTES: '{num} minú{{t|ta|ty|ty|t}}',

is wrong. Can you help to fix it?
In dev-build it is:
NUM_DEVICES: '{num} Zariadenia{{s}}',
NUM_TEMP_SENSORS: '{num} Teplotné snímače{{s}}',
NUM_ANALOG_SENSORS: '{num} Analógové snímače{{s}}',
NUM_DAYS: '{num} dní{{s}}',
NUM_SECONDS: '{num} sekúnd{{s}}',
NUM_HOURS: '{num} hodín{{s}}',
NUM_MINUTES: '{num} minút{{s}}',

from ems-esp32.

SoftVienka avatar SoftVienka commented on June 20, 2024

I tried this too, but it also didn't work.
So I solved it my way.

NUM_DEVICES: 'Zariadenia - {num} ',
NUM_TEMP_SENSORS: 'Teplotné snímače - {num} ',
NUM_ANALOG_SENSORS: 'Analógové snímače - {num} ',
NUM_DAYS: '{num} d.',
NUM_SECONDS: '{num} sek.',
NUM_HOURS: '{num} hod.',
NUM_MINUTES: '{num} min.',

I slightly adjusted the SK translations.
Nothing major, it just reads better.

index.ts.SK.txt

from ems-esp32.

SoftVienka avatar SoftVienka commented on June 20, 2024

These plurals

NUM_DEVICES: '{num} Zariaden{{í|ie|ia|ia|í}}',
NUM_TEMP_SENSORS: '{num} Teplotn{{ých|ý|é|é|ých}} snímač{{ov||e|e|ov}}',
NUM_ANALOG_SENSORS: '{num} Analogov{ých|ý|é|é|ých}} snímač{{ov||e|e|ov}}',
NUM_DAYS: '{num} d{{ní|eň|ní|ní|ní}}',
NUM_SECONDS: '{num} sek{{únd|unda|undy|undy|únd}}',
NUM_HOURS: '{num} hod{{ín|ina|iny|iny|ín}}',
NUM_MINUTES: '{num} minú{{t|ta|ty|ty|t}}',

should be correct. I don't know why it doesn't work.

In the Polish translation it is functional.

NUM_DEVICES: '{num} urządze{{ń|nie|nia|nia|ń}} EMS',
NUM_TEMP_SENSORS: '{num} czujni{{ków|k|ki|ki|ków}} temperatury',
NUM_ANALOG_SENSORS: '{num} inn{{ych|e|e|e|ych}} urządze{{ń|nie|nia(two)|nia|ń}} podłączon{{ych|e|e|e|ych}} do EMS-ESP',
NUM_DAYS: '{num} d{{ni|zień|ni|ni|ni}}',
NUM_SECONDS: '{num} sekun{{d|da|dy|dy|d}}',
NUM_HOURS: '{num} godzi{{n|na|ny|ny|n}}',
NUM_MINUTES: '{num} minu{{t|ta|ty|ty|t}}',

from ems-esp32.

MichaelDvP avatar MichaelDvP commented on June 20, 2024

It does not like the empty field, it's working with:

  NUM_TEMP_SENSORS: '{num} Teplotn{{ých|ý|é|é|ých}} sníma{{čov|č|če|če|čov}}',
  NUM_ANALOG_SENSORS: '{num} Analogov{ých|ý|é|é|ých}} sníma{{čov|č|če|če|čov}}',

from ems-esp32.

SoftVienka avatar SoftVienka commented on June 20, 2024

So there was a dog buried here.
Moreover was missing there one compound parenthesis
...Analogov{ých...
...Analogov{{ých...
Now it doesn't throw the error anymore.

But ...

  • 0 sekúnd - OK
  • 1 sekunda - OK
  • 2 sekundy - OK
  • 3 sekundy - OK
  • 4 sekundy - OK
  • 5 sek - NO OK
  • 6 sek - NO OK
    etc, etc

It will probably be the same with other plurals.

I tried to transcribe this part of the translation from the Polish translation.
Same error. 0-1-2-3-4 OK, 5 or more NO OK.

from ems-esp32.

proddy avatar proddy commented on June 20, 2024

Could this be a bug in the i18n library that we should report? or is the "dog" somewhere else?

from ems-esp32.

MichaelDvP avatar MichaelDvP commented on June 20, 2024

@SoftVienka Your latest changes are now in the official dev, please check and close this issue if ok.

from ems-esp32.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.