Hi, I need to add a new language to my ojs 2.4.8
In detail I need to add the Asturian language Asturian language - Wikipedia
It has 639-2 and 639-3 code as ‘ast’ but seems that doesn’t have the typical 2 letter code (639-1??) needed in ojs/registry/locales.xml so… what can I do to add it?
if I use ast_ES could cause any problem? any implications?
Hmm, I don’t think we’ve run into a situation before where an ISO639-1 code wasn’t available.
There are places in the OJS codebase where language codes are assumed to be in a 2-letter format, and where changing it would cause trouble. The simplest solution – though I must stress that it’s wrong – is to pick an unused two-letter combination and use that; a proper solution, though, would be to find assumptions about the format within the codebase and adapt them to support both 2- and 3-letter codes.
Regards,
Alec Smecher
Public Knowledge Project Team
Hi @asmecher,
Thanks, seems that the reasonable solution is to pick an unused two-letter combination but…
do you know how this can affect into the exporting plugins to another systems different than ojs like pubmed, doi, doaj etc…? I mean, the two letter code is exported? or is the 3 one?
If the code is exported, I think that the destination system where you load this export could fail when It see a non valid language code, I’m wrong?
This issue is why I called this solution “wrong” above. But its impact will depend on what you require.
Each export format will behave differently according to the requirements of the format it’s needing to generate. CrossRef (off the top of my head) uses 3-letter language codes, and OJS uses. To map OJS’s 2-letter codes to 3-letter codes, it looks up the 2-letter code in registry/locales.xml and finds the 3-letter code there. So if my recollection is correct, CrossRef will not get the invented 2-letter code, but will see the 3-letter code you’ve assigned in registry/locales.xml that corresponds to it. But you can verify this by trying it and viewing one of the CrossRef exports.
Regards,
Alec Smecher
Public Knowledge Project Team