Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internationalization of kiwix-serve's backend #679

Merged
merged 28 commits into from
Apr 14, 2022
Merged

Commits on Apr 13, 2022

  1. Configuration menu
    Copy the full SHA
    a18dd82 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c574735 View commit details
    Browse the repository at this point in the history
  3. Enter I18nStringDB

    veloman-yunkan authored and mgautierfr committed Apr 13, 2022
    Configuration menu
    Copy the full SHA
    d029c2b View commit details
    Browse the repository at this point in the history
  4. i18n data is kept in and generated from JSON files

    Introduced a new resource compiler script kiwix-compile-i18n that
    processes i18n string data stored in JSON files and generates sorted C++
    tables of string keys and values for all languages.
    veloman-yunkan authored and mgautierfr committed Apr 13, 2022
    Configuration menu
    Copy the full SHA
    507e111 View commit details
    Browse the repository at this point in the history
  5. User language control via userlang query param

    This is a draft commit enabling the testing of the support for
    kiwix-serve internationalization.
    veloman-yunkan authored and mgautierfr committed Apr 13, 2022
    Configuration menu
    Copy the full SHA
    e4a0a02 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    577b6e2 View commit details
    Browse the repository at this point in the history
  7. URL-not-found message went into i18n JSON resource

    Yet, the URL-not-found message is not yet fully internationalized
    since its usage is hardcoded to English.
    veloman-yunkan authored and mgautierfr committed Apr 13, 2022
    Configuration menu
    Copy the full SHA
    202ec81 View commit details
    Browse the repository at this point in the history
  8. Enter ParameterizedMessage

    veloman-yunkan authored and mgautierfr committed Apr 13, 2022
    Configuration menu
    Copy the full SHA
    387f977 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b2526c7 View commit details
    Browse the repository at this point in the history
  10. Localized "No such book" 404 message for /random

    However the title and the heading of the 404 page are not localized yet.
    veloman-yunkan authored and mgautierfr committed Apr 13, 2022
    Configuration menu
    Copy the full SHA
    cb5ae01 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    1ace162 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    52d4f73 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    ca7e0fb View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    7793826 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    d2c864b View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    fbd23a8 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    6f3db20 View commit details
    Browse the repository at this point in the history
  18. "Go to welcome page" in taskbar isn't translated

    The (failing) tests now demonstrate that some text in the taskbar is not
    translated. Will fix in the next commit.
    veloman-yunkan authored and mgautierfr committed Apr 13, 2022
    Configuration menu
    Copy the full SHA
    901664b View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    c2bfeb4 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    f73be3c View commit details
    Browse the repository at this point in the history
  21. Testing the translation of "Go to the main page"

    The new test fails since the "Go to the main page" button is not yet
    internationalized.
    veloman-yunkan authored and mgautierfr committed Apr 13, 2022
    Configuration menu
    Copy the full SHA
    ed7717c View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    3da81a3 View commit details
    Browse the repository at this point in the history
  23. Testing the translation of "Go to random page"

    The new test fails since the "Go to random page" button is not yet
    internationalized.
    veloman-yunkan authored and mgautierfr committed Apr 13, 2022
    Configuration menu
    Copy the full SHA
    527a606 View commit details
    Browse the repository at this point in the history
  24. Internationalized "Go to a randomly selected page"

    At this point a potential issue has been revealed. Now we produce
    the final HTML via 2-level template expansion
    
    1. Render parameterized messages
    2. Render the HTML template
    
    In which templates we should use double mustache "{{}}" (HTML-escaping)
    tags and where we may use triple mustache "{{{}}}" (non-escaping) tags?
    veloman-yunkan authored and mgautierfr committed Apr 13, 2022
    Configuration menu
    Copy the full SHA
    11be821 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    5052d40 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    a0d9a82 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    9987fbd View commit details
    Browse the repository at this point in the history
  28. Preliminary support for Accept-Language: header

    In the absence of the "userlang" query parameter in the URL, the value
    of the "Accept-Language" header is used. However, it is assumed that
    "Accept-Language" specifies a single language (rather than a comma
    separated list of languages possibly weighted with quality values).
    
    Example:
    
    Accept-Language: fr
    // should work
    
    Accept-Language: fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5
    // The requested language will be considered to be
    // "fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5".
    // The i18n code will fail to find resources for such a language
    // and will use the default "en" instead.
    veloman-yunkan authored and mgautierfr committed Apr 13, 2022
    Configuration menu
    Copy the full SHA
    927c125 View commit details
    Browse the repository at this point in the history