Osmose

I make websites and chiptunes!

  • he/him

AKAs:
Lapsed Neurotypical
JavaScript's Strongest Warrior
Fake Podcast Host
Thotleader
Vertically Integrated Boyfriend
Your Fave's Mutual
Certified 5x Severals by the RIAA
Inconsistently Medicated
The Source That Views Back
Carnally Known
The Alternative


Homepage
osmose.ceo/

lokeloski
@lokeloski
This page's posts are visible only to users who are logged in.

lizbushouse
@lizbushouse
This page's posts are visible only to users who are logged in.

Osmose
@Osmose

GNU's gettext has the ngettext function for specifying a string with plural forms in your app code:

ngettext("%d file removed", "%d files removed", n)

On the translator side, it makes you write a really complex single line of code that encodes the rules of your language in selecting which translation to use:

"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"

#, c-format
msgid "One file removed"
msgid_plural "%d files removed"
msgstr[0] "%d slika uklonjenih"
msgstr[1] "%d slika uklonjenih"
msgstr[2] "%d slika uklonjenih"

Project Fluent came out of Mozilla's localization team and volunteer community after struggling with gettext and other translation systems for years while localizing Firefox. You write a source English FTL file:

shared-photos =
    {$userName} {$photoCount ->
        [one] added a new photo
       *[other] added {$photoCount} new photos
    } to {$userGender ->
        [male] his stream
        [female] her stream
       *[other] their stream
    }.

and then translators provide an FTL file for their language with the translations filled in place of the English, with more plural forms specified as needed.

What I only learned today is that that one other stuff describing which plural forms are available are actually a standard provided in the Unicode CLDR. If you look up Polish, for example, you can see that few is used for the plural form for numbers ending in 2, 3, or 4, and many is used for the other non-fractional plurals.

(Fluent also supports arbitrary string keys, as seen with the gender selector above—"male" and "female" aren't built into Fluent, they are arbitrary keys and could be expanded to include any pronoun forms desired.)

Anyone making software that needs to be translated should be using a localization library of some sort, there's way too many edge cases and variations for you to be handling this stuff yourself!



Osmose
@Osmose
  • mise en place
  • egg cup
  • souffle (I've never done this)
  • secret late night peanut butter + chocolate chip
  • microwave one serving of leftover tomato sauce
  • spoon rest
  • dipping sauce because fuck those tiny plastic cups, homie
  • beat a single egg
  • whipped cream decanter when you're fancy
  • Lego and gunpla part sorting
  • spider cup
  • melted butter
  • fart noises with your hand
  • muffin stuff
  • egg sandwich... Okay this is just egg cup with bread my bad
  • a weirdly small amount of grapes
  • single serving of cookie dough
  • cinnamon sugar mix for tortilla elephant ears