Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
663 views
in Q2A Core by

 

Instead of requiring that we modify the default qa-lang-* files, which means a bit of a headache during upgrades, it would be great if specific words and phrases could be overridden for en-US the same way it's done for other languages.  I was thinking about adding an en-US2 option to qa_admin_language_options(), but it might be better to just permit an en-US subdirectory of qa-lang that would be checked before using the default settings, if no other language is selected.  That or don't map 'English (US)' to '' and instead map 'default' to '' and add 'English (US)' mapped to 'en-US'.

 

related to an answer for: How to Edit English in USA?
by
I think that would be great. What I did instead is set my site to en-GB so I could change those instead of the original one.
by
Yeah, I was actually considering that, too.  And maybe I will.  Just seems like it should be easy enough to permit an actual en-US override.

1 Answer

0 votes
by

So here's what I've done:

- added an option to the array in qa_admin_language_options()

 

'en-US' => 'English (US)',
 
- initialized the options array to empty, instead of with '' => 'English (US)'
 
$options=array();
 
- after the loop to detect existing language options (subdirs) for the select input, check to see if an en-US option was found, otherwise add the old '' option
 
if (!isset($options['en-US'])) $options[''] = 'English (US)';
 
So, if there's an en-US subdirectory in qa-lang, that's what the 'English (US)' select option will point to, otherwise it will point to '', using the default files in qa-include.
 
Seems to work.  Would be nice if this or an alternate solution were rolled into a future iteration of Q2A.

...