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

    flat-musician-80308

    02/10/2023, 6:11 PM
    with && || you get a lot of repetition I think
  • b

    bright-gpu-74537

    02/10/2023, 6:11 PM
    right
  • f

    flat-musician-80308

    02/10/2023, 6:12 PM
    personally I like ranges, ranges are clear as well 馃檪
  • b

    bright-gpu-74537

    02/10/2023, 6:12 PM
    i defo like the ranges more
  • b

    bright-gpu-74537

    02/10/2023, 6:12 PM
    how would this look with ranges:
  • b

    bright-gpu-74537

    02/10/2023, 6:13 PM
    Copy code
    count={
       itemCount = 0: Nie masz 偶adnych aktywnych projekt贸w
       itemCount = 1: Masz jeden aktywny projekt
       itemCount = 11: Masz %itemCount% aktywnych projekt贸w
       itemCount = 12: Masz %itemCount% aktywnych projekt贸w
       itemCount = 13: Masz %itemCount% aktywnych projekt贸w
       itemCount = 14: Masz %itemCount% aktywnych projekt贸w
       itemCount mod 10 = 0: Masz %itemCount% aktywnych projekt贸w
       itemCount mod 10 = 1: Masz %itemCount% aktywnych projekt贸w
       itemCount mod 10 <= 4: Masz %itemCount% aktywne projekty
       itemCount mod 10 > 5: Masz %itemCount% aktywnych projekt贸w
    }
  • b

    bright-gpu-74537

    02/10/2023, 6:13 PM
    ?
  • b

    big-angle-82801

    02/10/2023, 6:13 PM
    and 11...14 is treated normally, it just requires a special case here so that it doesn't get caught up in the rule for 22...24, 32...34, etc 馃槢 (because, as in many indo-european languages including english, 11-19 don't follow the later rules for 20+ numbers)
  • b

    bright-gpu-74537

    02/10/2023, 6:14 PM
    2 items, 18 items, 22 items, 374 items
  • b

    bright-gpu-74537

    02/10/2023, 6:14 PM
    or do you mean ordinals?
  • b

    bright-gpu-74537

    02/10/2023, 6:14 PM
    like "rd", "th" etc
  • b

    big-angle-82801

    02/10/2023, 6:15 PM
    i mean like how "nineteen" is not "ten nine", compared to "twenty nine"
  • f

    flat-musician-80308

    02/10/2023, 6:15 PM
    2 przedmioty, 18 przedmiot贸w, 22 przedmioty, 374 przedmioty (but 28 przedmiot贸w and 375 przedmiot贸w)
  • b

    bright-gpu-74537

    02/10/2023, 6:15 PM
    oh, i see
  • f

    flat-musician-80308

    02/10/2023, 6:15 PM
    you guys have it easy in English 馃槃
  • b

    bright-gpu-74537

    02/10/2023, 6:15 PM
    a fucking men 馃槃
  • f

    flat-musician-80308

    02/10/2023, 6:19 PM
    Copy code
    count = { 
       itemCount = 0: Nie masz
       _: Masz
    } {
       itemCount = 0: 偶adnych aktywnych projekt贸w
       itemCount = 1: jeden aktywny projekt
       itemCount in 11...14: %itemCount% aktywnych projekt贸w
       itemCount mod 10 in 2...4: %itemCount% aktywne projekty
       _: %itemCount% aktywnych projekt贸w
    }
    this would be good unless I messed something up here
  • f

    flat-musician-80308

    02/10/2023, 6:19 PM
    (breaks on first match)
  • b

    big-angle-82801

    02/10/2023, 6:19 PM
    well, i mean english has its own problems, like spelling 馃槄 but i guess at least it doesn't require adding special syntax for localisation of numbers...
  • f

    flat-musician-80308

    02/10/2023, 6:20 PM
    hey at least it's not spelling out the numbers
  • f

    flat-musician-80308

    02/10/2023, 6:20 PM
    because that would be fun to write
  • b

    big-angle-82801

    02/10/2023, 6:22 PM
    I'm sure I've done a project euler question that required doing that in english, or counting up the characters or something like that
  • b

    bright-gpu-74537

    02/10/2023, 6:49 PM
    cheers guys... enlightening, slightly infuriating for some reason ( 馃槃 ), and great test data 馃檪
  • c

    cuddly-finland-31869

    02/10/2023, 6:53 PM
    Has anyone combined haxeui html5 and hxasync? I'm trying to get some json-rpc communication going with a backend. I've exposed
    fetch
    with an extern, and can call it fine. It returns a
    Promise
    and I'm wonder how best to work with this in haxeui.
  • b

    bright-gpu-74537

    02/10/2023, 6:54 PM
    in what sense? Just do "whatever you like" in the promise result... i use promises all the time...
  • b

    bright-gpu-74537

    02/10/2023, 6:55 PM
    Copy code
    fetch(...).then(result -> {
        something.text = result.whatever;
    });
  • c

    cuddly-finland-31869

    02/10/2023, 6:56 PM
    Okay, so with
    then
    and callbacks. Was just wondering if it was possible to use
    async
    and
    await
    style.
  • b

    bright-gpu-74537

    02/10/2023, 6:56 PM
    ah, no, you cant, but thats a haxe thing, not really a haxeui thing... async / await dont exist in haxe
  • b

    bright-gpu-74537

    02/10/2023, 6:57 PM
    or do you mean the hxasync metadata?
  • c

    cuddly-finland-31869

    02/10/2023, 6:58 PM
    yea, if it was possible for it to play together with haxeui somehow
1...150015011502...1687Latest