= Bug 271747: Custom Language Codes UI = This is an oversized branch, and it's not particularly urgent. Review it only if you feel like it, or something's changed and we've begged you to do it. Some projects or Ubuntu packages insist on using nonstandard language codes. To deal with those we created, long ago, "custom language codes" which allow the import approval process to recognize that an upload with a given "weird" language code is actually, by the project's or package's standard, a translation for a given language. We don't advertise this feature, and it's not frequently used. Project owners do not get access to it. It's really only there for a few problem cases like OpenOffice.org, which not only use nonstandard language codes but also add or move templates regularly. If it were just a matter of a single translation, you could simply approve it once and the approver would remember the path and associate it with the right translation. However, it is a pain in the neck to have to write SQL, get approval, and go through LOSAs every time we want one of these babies added. So this branch finally creates a simple UI for dealing with them. The simple UI lists custom language codes, shows them in detail, adds them, and removes them. For non-admins there's a read-only view of the whole thing, which may come in handy when debugging, but we don't link to them because generally speaking, custom language codes are probably the wrong solution for a project having problem with its language codes. And it adds one more knob to twiddle, providing one more thing that may go wrong with import approvals. One limitation: this branch allows only Launchpad admins to manipulate custom language codes. In future we'll also want to allow Rosetta admins to do this. But that required some fiddling to check for the right permissions. This branch is already oversized, so instead I intend to file a separate bug about it. == Tests == {{{ ./bin/test -vv -t custom-language-codes.txt }}} == Demo, Q/A, and UI review == Log in as a Launchpad administrator. Go to the Translations page for a project or source package with translations. On staging: https://translations.staging.launchpad.net/josm/ On a development machine: https://translations.launchpad.dev/evolution/ At the bottom of the right-hand side column you'll see a note: "If necessary, you may for this project." Click on the link to get to the custom language codes UI for the project. The page it takes you to is an overview, probably of nothing as yet. Try adding a custom language code: map a custom "language code" to an actual language, or to no language at all. (If you map to no language, uploads with that language code string will quietly disappear—useful but one of those things that can cause support headaches if misused). "Weird" characters are rejected; we don't want to be able to redefine the ".po" filename extension to refer to a language or anything like that. Whatever you add will show up in the listing. You can also remove or view the codes. Viewing them doesn't give you much, besides a link to the language, but it was needed to make the ZCML "fit" without breaking non-admin access. Otherwise, the UI should really be self-explanatory. There is no Edit option; if you don't like a custom language code then you delete it and create the one you did want. Jeroen