ExposeTranslationBundle Unit Tests

Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)

Tests completed in 22 milliseconds.
87 tests of 87 passed, 0 failed.

  1. Translator: api definition (0, 5, 5)Rerun
    1. Translator is defined
    2. Translator.trans is a function
    3. Translator.transChoice is a function
    4. Translator.add is a function
    5. Translator.fromJSON is a function
  2. Translator: add() (0, 1, 1)Rerun
    1. The add method returns a Translator
  3. Translator: trans() (0, 11, 11)Rerun
    1. Returns the correct message for the given key
    2. Returns the correct message for the given key
    3. Returns the correct message for the given key
    4. Empty key returns empty message
    5. Unknown key returns the key as message
    6. Returns the message with correct replaces
    7. Returns the message with correct replaces
    8. Returns the message with correct repeat replaces
    9. An empty string translation should return the empty string and not the key.
    10. Message not in the domain with args returns the processed message
    11. Returns the message with correct replaces with $0 present in target value
  4. Translator: transChoice() (0, 31, 31)Rerun
    1. Returns the correct message for the given key
    2. number = 0 returns the {0} part of the message
    3. number = 1 returns the [1,Inf[ part of the message
    4. number = 100 returns the [1,Inf[ part of the message
    5. number = 0 returns the {0} part of the message
    6. number = 1 returns the {1} part of the message
    7. number = 2 returns the [2,Inf[ part of the message
    8. number = 100 returns the [2,Inf[ part of the message
    9. number = -100000 returns the ]-Inf,0] part of the message
    10. number = -1 returns the ]-Inf,0] part of the message
    11. number = 0 returns the {0} part of the message
    12. number = 1 returns the {1} part of the message
    13. number = 1000 returns the [2,Inf[ part of the message
    14. number = 0 returns the {0} part of the message
    15. number = 1 returns the standard rule
    16. number = 10 returns the "a_few" part of the message
    17. number = 20 returns the [20,Inf] part of the message
    18. number = 0 returns the {0} part of the message
    19. number = 1 returns the [1,Inf[ part of the message
    20. number = 100 returns the [1,Inf[ part of the message
    21. number = 0 returns the {0} part of the message
    22. number = 1 returns the [1,Inf[ part of the message
    23. number = 100 returns the [1,Inf[ part of the message
    24. number = 1 returns the single available translation
    25. number = 2 returns the single available translation
    26. number = 0 returns the {0} part of the message
    27. number = 0 returns the [0, 1] part of the message
    28. number = 1 returns the [0, 1] part of the message
    29. number = 5 returns the ]1,Inf[ part of the message
    30. number = 10 returns the [0,Inf[ part of the message
    31. number = 10 returns the [0,Inf[ part of the message
  5. Translator: guesses domains if not specified (0, 8, 8)Rerun
    1. Returns the first guessed message corresponding to the given key
    2. Guesser does not impact basic usage of get
    3. Returns the correct guessed message
    4. Returns the key as the key cannot be guessed
    5. Returns the correct guessed message
    6. Returns the correct guessed message
    7. Returns the key as it does not exist in the given domain
    8. okay
  6. Translator: loads data from JSON string (0, 4, 4)Rerun
    1. JSON parser processes locale from valid JSON string
    2. JSON parser processes messages from valid JSON string
    3. JSON parser processes messages from valid JSON string
    4. JSON parser processes messages from valid JSON string
  7. Translator: loads data from JSON object literal (0, 6, 6)Rerun
    1. JSON parser processes locale from valid object literal
    2. JSON parser processes messages from valid object literal
    3. JSON parser processes messages from valid object literal
    4. JSON parser processes messages from valid object literal
    5. okay
    6. okay
  8. Translator: deals with multiple locales (0, 3, 3)Rerun
    1. okay
    2. okay
    3. okay
  9. Translator: uses fallback if the given locale does not contain the message (0, 4, 4)Rerun
    1. okay
    2. okay
    3. okay
    4. okay
  10. Translator: retry on fallback when locale exist but not the domain (0, 5, 5)Rerun
    1. okay
    2. okay
    3. okay
    4. okay
    5. okay
  11. Translator: gets the current locale using the `lang` attribute on the `html` tag (0, 1, 1)Rerun
    1. okay
  12. Translator: finds longer locale names (0, 1, 1)Rerun
    1. okay
  13. Translator: searches in part domain, if not exists in full domain (0, 2, 2)Rerun
    1. okay
    2. okay
  14. Translator: searches in fallback domain, if not exists in full or part domain (0, 2, 2)Rerun
    1. okay
    2. okay
  15. Translator: works with given optional parameters (0, 2, 2)Rerun
    1. okay
    2. okay
  16. Translator: searches in country fallback, if not exists in full domain (0, 1, 1)Rerun
    1. okay