https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • i

    icy-zebra-52882

    02/10/2023, 10:03 AM
    it doesn't actually transform the text in the file
  • b

    bright-gpu-74537

    02/10/2023, 10:03 AM
    but that would just be the parser, it would end up as a .po
  • i

    icy-zebra-52882

    02/10/2023, 10:03 AM
    the first one is what's stored in the PO
  • i

    icy-zebra-52882

    02/10/2023, 10:04 AM
    when I say string key, I mean that you access the translation via something like
    Lang.t._("My source string")
  • i

    icy-zebra-52882

    02/10/2023, 10:04 AM
    Lang
    being what deepnight called his module here
  • b

    bright-gpu-74537

    02/10/2023, 10:04 AM
    yeah, in haxeui its
    {{foo}} and {{bar}}
    (i think)
  • i

    icy-zebra-52882

    02/10/2023, 10:05 AM
    generally
    t
    is the gettext instance,
    _
    is shorthand for the translation function
  • b

    bright-gpu-74537

    02/10/2023, 10:06 AM
    it sounds like po is the way to go... i think ill know about all this stuff at compile time to... so i can pass of that crazy plural calc to the haxe compiler and get it to make a function for me
  • b

    bright-gpu-74537

    02/10/2023, 10:06 AM
    which does mean you wont be able to load .po files and runtime, but i kinda think thats fine
  • i

    icy-zebra-52882

    02/10/2023, 10:07 AM
    will that support switching app languages?
  • b

    bright-gpu-74537

    02/10/2023, 10:07 AM
    sure
  • b

    bright-gpu-74537

    02/10/2023, 10:07 AM
    just means that the languages you can switch between is static
  • b

    bright-gpu-74537

    02/10/2023, 10:07 AM
    actually, that might be shit
  • b

    bright-gpu-74537

    02/10/2023, 10:08 AM
    like maybe you want to tweak a local install by just changing a .po file 🤔
  • i

    icy-zebra-52882

    02/10/2023, 10:08 AM
    it's a question of scope, you can say "haxeui supports these languages"
  • b

    bright-gpu-74537

    02/10/2023, 10:09 AM
    i have a simple expression parser, but im not confident it could handle
    ((n==1)?(0):(((((n%10)>=2)&&((n%10)<=4))&&(((n%100)<10)||((n%100)>=20)))?(1):2));
  • i

    icy-zebra-52882

    02/10/2023, 10:09 AM
    also the current deepnight gettext implementation doesn't let you do the pluralisation, so you can't currently do something like
    Copy code
    hx
    Lang.t._("Close tab", "Close ::count:: tabs", { count => tabCount });
  • i

    icy-zebra-52882

    02/10/2023, 10:10 AM
    PO is also essentially expecting english as the source language, which is why it only supports singular or singular-and-plural as source strings
  • b

    bright-gpu-74537

    02/10/2023, 10:11 AM
    yeah, i wonder how that would work for me, currently, iirc you can do
    {{Foo, 1, 2, 3}}
    ... the 1, 2, 3 just being params, nothing to do with pluralisation
  • i

    icy-zebra-52882

    02/10/2023, 10:12 AM
    if I were better I'd make a Fluent implementation for haxe, or at least finish the gettext one
  • f

    full-journalist-82607

    02/10/2023, 10:16 AM
    @icy-zebra-52882 has leveled up ! 📈
  • f

    full-journalist-82607

    02/10/2023, 10:17 AM
    ability gained : Fluency
  • b

    bright-gpu-74537

    02/10/2023, 10:19 AM
    i do like fluent the most, but it just seems like (maybe) total overkill
  • b

    bright-gpu-74537

    02/10/2023, 10:19 AM
    and it seems like .po is the standard (and ofc, a lot easier to impl)
  • i

    icy-zebra-52882

    02/10/2023, 10:20 AM
    yeah fluent is pretty new, and JS-focused for now
  • i

    icy-zebra-52882

    02/10/2023, 10:20 AM
    PO is standard in the linux GNU world, to some degree
  • i

    icy-zebra-52882

    02/10/2023, 10:21 AM
    for english there isn't much translator difference
  • i

    icy-zebra-52882

    02/10/2023, 10:22 AM
    fluent aims to shine where neither the source nor target languages are English, for example, French to German
  • b

    bright-gpu-74537

    02/10/2023, 10:22 AM
    it certainly seems a lot more featureful
  • i

    icy-zebra-52882

    02/10/2023, 10:22 AM
    in fact it seems to assume any language can be the source or target
1...148714881489...1687Latest