Integrating Unicode CLDR: Adding Locale Support
So far translation data is ready to be used for translation of date strings. This includes combined data from unicode CLDR and supplementary data contributed by many individuals. Initially the data from unicode CLDR was stored as json files and supplementary data was stored as yaml files and data from both these sources were to be combined after loading each separately which was then supposed to be used for translating dates. But after discussion with my mentor we agreed upon a better approach suggested by him that we could store data directly in python modules. Storing data in python modules directly has the advantage that importing data from python modules is faster than loading from json and yaml files. And considering the fact that we don't have to combine data from cldr and supplementary data files at run time, storing data in Python modules proves to be much more efficient.
As the data is ready, now is the time to make necessary modifications in the codebase to support locales for date parsing. The modifications would be adding arguments locales, and region in addition to existing languages argument in parse function as I mentioned in my proposal; creating Locale class to create locale instances for translation; making changes to loader to support lazy importing of languages' data from python modules and later yielding required locale instances for translation; and finally making changes to parser to support translation with new data. I am currently working on the first three parts, and after completing it I will make relevant changes to parser.
As the data is ready, now is the time to make necessary modifications in the codebase to support locales for date parsing. The modifications would be adding arguments locales, and region in addition to existing languages argument in parse function as I mentioned in my proposal; creating Locale class to create locale instances for translation; making changes to loader to support lazy importing of languages' data from python modules and later yielding required locale instances for translation; and finally making changes to parser to support translation with new data. I am currently working on the first three parts, and after completing it I will make relevant changes to parser.