TL;DR: Can we move plans.locale.*.taxation
to plans.taxation.*
?
Background
Normally in Django apps, the locale
directory would just contain locale/*/LC_MESSAGES/*.[pm]o
. Thus, locale
is not normally a package inside the app package.
However, plans.locale
is a package, containing locale/*/taxation.py
, the taxation policies. There are a few problems with this.
Problem 1: it breaks tooling
This causes problems with some tooling, for if you are in the plans
directory locale
shadows the built-in module locale
, meaning that various things simply break. (Normally, in Python 2, it would lack __init__.py
and thus not be loaded.) Notably, anything that uses optparse
(which uses gettext
, which uses locale
) will fail. Thus, django-admin.py
, pylint
and pep8
are three things which immediately fail. This causes minor damage to the way I have Vim set up for myself, but isn't a very serious problem.
Problem 2: it's semantically unsound
Only POSIX locale names belong in there.
Taxation policies are based upon jurisdictions; locales are not. For example, en
is a language, English, and is acceptable as a locale identifier but is clearly not useful as an identifier for a taxation policy. Conversely, eu
is not a locale, but a jurisdiction useful for such distinctions as taxation policy. (In fact, many locales will be used inside the EU. de
, de_at
, en
, fr
, pt
, es
, etc.)
An example of where this really falls apart: Canada (CA
). There are two official languages spoken in Canada, English (en
, thus en_CA
) and French (fr
, thus fr_CA
). As it happens, there is also a language with the code ca
: Catalan. By the current scheme in plans.locale
, any Canadian taxation policy is stuck, as it doesn't belong in en_CA
and fr_CA
, as it's the same for both of them, nor does it belong in ca
, as that is for Catalan. Another example is India: the country is IN
, there are many languages inside it en_IN
, hi
, bn_IN
, te
, ta
, and many more) and in
is for Indonesian.
The solution
I suggest that plans.locale.*.taxation
be shifted to plans.taxation.*
(*
encompassing, at present, ru
and eu
.) This will, incidentally, make plans.taxation
a package rather than a module.
Indicate that you're happy with this change and I'm willing to implement it.
(I believe I'm likely to be using this app, and I'm in Australia. I'll need to verify further if the model employed here is appropriate for our GST, but it looks like it.)