liqd / adhocracy

Adhocracy is a policy drafting and decision making software for distributed groups and open institutions.
GNU Affero General Public License v3.0
150 stars 37 forks source link

Feature fix language negotiation #895

Closed nidico closed 10 years ago

nidico commented 10 years ago

894 was only partly correct:

The previous "fix" of adding {'pt':'pt_BR'} as locale alias actually replaced the original babel alias dict and therefore only had the intended effect by accident and only Portuguese survived the babel language negotiation process!

The real problem was that Babel language negotiation can only compare language codes using the same separator. As we use underscores and browsers send dashes, we now convert our static list to use dashes as well for the negotiation.

In the second commit the LOCALE_ALIASES feature is used in order to make Brazilian (and not English or whatever) show up if Portuguese is requested.

xi commented 10 years ago

Works fine. The only strange thing is that you again used an underscore when defining the pt alias. Works either way. Merging.