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

    bright-gpu-74537

    02/10/2023, 2:39 PM
    im sure the welsh fall into those categories somewhat, but i am mainly thinking of africa and india
  • c

    clever-yak-82528

    02/10/2023, 2:39 PM
    Of course
  • c

    clever-yak-82528

    02/10/2023, 2:39 PM
    ...by the way, how does localisation work in haxeui?
  • b

    bright-gpu-74537

    02/10/2023, 2:39 PM
    scroll up about 1000 pages šŸ˜„
  • c

    clever-yak-82528

    02/10/2023, 2:40 PM
    I read through it but I didn't get much from it
  • b

    bright-gpu-74537

    02/10/2023, 2:40 PM
    but basically
    {{foo}}
    gets replaced by another string... it does a little more than that, but not much more
  • b

    bright-gpu-74537

    02/10/2023, 2:40 PM
    and certainly nothing NO WHERE NEAR clever enough (as i've learnt today)
  • b

    bright-gpu-74537

    02/10/2023, 2:41 PM
    ā˜ļø this is basically the plan
  • b

    bright-gpu-74537

    02/10/2023, 2:41 PM
    probably still not perfect, but better then what there is currently i think
  • b

    bright-gpu-74537

    02/10/2023, 2:44 PM
    my biggest stumbling point is the plurals stuff in the .po file
  • b

    bright-gpu-74537

    02/10/2023, 2:44 PM
    i have a SimpleExpressionParser... but im basically 100% sure that its not gonna work with things that complex
  • b

    bright-gpu-74537

    02/10/2023, 2:49 PM
    falls over on the first hurdle:
    Copy code
    haxe
    SimpleExpressionEvaluator.eval("a == 2", {a: 2, b: 3}); // true
    SimpleExpressionEvaluator.eval("(a == 2)", {a: 2, b: 3}); // false
    🄳
  • c

    clever-yak-82528

    02/10/2023, 2:49 PM
    i would be quite interested in helping with that
  • c

    clever-yak-82528

    02/10/2023, 2:50 PM
    can you not use hscript or something?
  • b

    bright-gpu-74537

    02/10/2023, 2:50 PM
    i dont want the dependency, thats was the whole reason for it in the first place
  • c

    clever-yak-82528

    02/10/2023, 2:51 PM
    fair enough
  • c

    clever-yak-82528

    02/10/2023, 2:51 PM
    can you copy from haxe itself?
  • b

    bright-gpu-74537

    02/10/2023, 2:51 PM
    from hscript you mean?
  • b

    bright-gpu-74537

    02/10/2023, 2:52 PM
    the problem with simpleexpressioneval is it was never supposed to work with things like
    ((n==1)?(0):(((((n%10)>=2)&&((n%10)<=4))&&(((n%100)<10)||((n%100)>=20)))?(1):2));
  • c

    clever-yak-82528

    02/10/2023, 2:52 PM
    i mean, haxe the language has to have an expression parser somewhere in it
  • b

    bright-gpu-74537

    02/10/2023, 2:52 PM
    OCaml i presume
  • c

    clever-yak-82528

    02/10/2023, 2:52 PM
    oh, yeah, probably
  • c

    clever-yak-82528

    02/10/2023, 2:52 PM
    you could use something more like what crowdin does
  • c

    clever-yak-82528

    02/10/2023, 2:53 PM
    https://support.crowdin.com/icu-message-syntax/
  • b

    bright-gpu-74537

    02/10/2023, 2:53 PM
    you know what though... i could use haxe's ast as a sort of guide though... i mean, we know it works
  • c

    clever-yak-82528

    02/10/2023, 2:54 PM
    example from mastodon:
    {count, plural, one {{counter} person} other {{counter} people}} in the past {days, plural, one {day} other {{days} days}}
    =>
    {count, plural, zero {neb} one {{counter} person} two {{counter} berson} few {{counter} pherson} many {{counter} pherson} ={<10} {{counter} person} other {{counter} o bobl}} yn y {days, plural, one {diwrnod diwethaf} two {ddeuddydd diwethaf} other {{days} diwrnod diwethaf}}
  • b

    bright-gpu-74537

    02/10/2023, 2:54 PM
    it would be easier if i said "all language files have to available at compile time", then i could offload it all to the haxe compiler... but the more i think about it the more i think its valid for an application to have the option to discover and load language files at runtime
  • c

    clever-yak-82528

    02/10/2023, 2:55 PM
    it's very useful, especially for development, but it also means more files for the user to have to download and keep track of
  • b

    bright-gpu-74537

    02/10/2023, 2:56 PM
    it would be optional, ofc, you could also just package them into your app and be done with it
  • b

    bright-gpu-74537

    02/10/2023, 2:56 PM
    but if it is an option (as i think it should be) it means i cant build the expression from the string at compile time
1...149414951496...1687Latest