Language variants should know their parent language

Bug #125545 reported by Curtis Hovey
0
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

Languages do not know if they are a parent or a variant language. we often use
is_english variant() which does
    language.code[0:3] in ['en_']
to check if the language is a variant. This is not efficient when we want to query the db for Engligh or English variant. The Language table and object should have an parent_language column/attribute that can be queried to get the list of Persons who speak a language (because variants count as parent languages). Ah but not that is not true of pt and pt_BR, so testing the Language.code will not work. Fix model, so our code can get this right.

Changed in launchpad:
importance: Undecided → Medium
status: New → Confirmed
Curtis Hovey (sinzui)
tags: added: tech-debt
Revision history for this message
Robert Collins (lifeless) wrote :

@sinzui Can you explain this a little more? As I read the description we want to do something efficiently and we can't, but the thing we do today isn't correct anyway...

Curtis Hovey (sinzui)
Changed in launchpad:
importance: Medium → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.