Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-lingual support #12

Open
AllenEllis opened this issue Jan 6, 2020 · 0 comments
Open

Multi-lingual support #12

AllenEllis opened this issue Jan 6, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@AllenEllis
Copy link
Owner

I received a suggestion to have a Spanish language version of the app. I think the move would be to host languages at $lang.$baseurl. For example, https://es.everysinglemonth.org. Then some code near the top of index.php would identify the language from $_SERVER['REQUEST_URI].

Because the $lang variable will be used to determine file paths later, we should whitelist languages that we know we have. For now, that could be as simple as:
if($lang != "en" && $lang != "es") $lang = "en";

We'd move the contents of templates into templates/en. Any other copy (like error messages) presented to users should be moved to new template files. Update do_tempate() to pull the correct templates based on the global $lang variable.

Any code that reads or writes to the exports directory should instead point to exports/$lang.

Once this is done and working, then we can duplicate the contents of templates/en -> templates/es and recruit some help translating the language.

Unfortunately this will result in more duplicate work if we are to ever modify templates in the future. For the moment I think this is preferable to building a whole new language engine, given that we're not likely to do many translations at this point.

@AllenEllis AllenEllis added the enhancement New feature or request label Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant