Skip to content
  • anonym's avatar
    Completely rework how we localize our browser. · 4a6fc859
    anonym authored
    Previously these parts have been spread out in several, heavily
    coupled hooks and static configurations, making it very hard to get an
    overview of how it all actually works. Now we instead do everything in
    one place, and generate things programatically as much as possible,
    which makes supporting another locale much simpler (just adding a
    single line with a few pieces of needed info!). Consequently this
    commit also adds better localization for every locale supported by the
    Tor Browser (added: ar, es, fa, ko, nl, pl, ru, tr, vi and zh_CN)
    instead of the euro-centric (w.r.t. actually adding localization) ones
    we had picked before. Also, we'll get build level errors for many
    types of errors, so they're caugt early.
    
    This commit may seem like a gigantic, non-atomic beast, but splitting
    it would be hard, and it actually mostly removes stuff. Its design is
    simple: We have a description file that, for each supported Tor
    Browser locale, has the extra pieces of info needed, like the
    localized name of the language, the parameters needed for certain
    search engines etc. Then we apply them to:
    
    * a templates for the amnesia branding locale file, and put in the
      relevant values there so the default search engine is selected, the
      correct spellchecker (if installed) is pre-selected, and our
      homepage is localized (if supported).
    
    * a template for each of the search engines we want to localize
      (currently Start Page and Disconnect.me -- we could do Google but
      most (all?) locales get a localized one from the Iceweasel
      localization packages) and generate localized ones.
    
    Also, following the Tor Browser's recent switch, we now use
    Disconnect.me as the default search engine, although we localize it
    for each supported locale.
    
    Will-fix: #9309
    4a6fc859