Search results

Matches found for tag 'Multilanguage': 8

13 November 2019 Updated 13 November 2019 by Peter
post main image
How to implement Flask multilanguage is explained in the Flask docs, see links below. But this is just a starting point. You need deeper understanding of the process to handle special cases like falling back to a default language, language switching, and the 404 Page Not Found exception. Assumptions In the remainder of this post we are using a language code, 'lang_code', that is available in the ...
Read more
28 September 2019 Updated 11 October 2019 by Peter
post main image
Update 11 October 2019: I changed the addon-tag from '{% addon: ... %}' to '[[ addon: ... ]]'. The reason is that I wanted to be able to render the page text coming from the database, using render_template_string, and '{% ... %}' conflicts with Jinja2 tags. And yes, I do not want to implement a Jinja2 custom tag.  What is difficult about implementing a contact page with a contact form with Flask ...
Read more
15 September 2019 Updated 15 September 2019 by Peter
post main image
Before you read on, you may want to read my previous posts about multilanguage and language fallback, see links below. When I gave myself the assignment to develop and implement a multilanguage Flask website with SQLAlchemy I knew things could get difficult. I did not really took the time to design everything beforehand, I just read a lot about multilanguage on the internet and trusted my experience ...
Read more
14 September 2019 Updated 14 September 2019 by Peter
post main image
Before you read on, you may want to read my previous post about language fallback, see link below. Here you have an example of the complexity of multilanguage. The link should be shown in the language you are using at the moment ... another time.   Life is one long big sequence of problems we are solving all the time. It starts with getting enough oxygen, solved by breathing, maybe second ...
Read more
11 September 2019 Updated 12 September 2019 by Peter
post main image
In a previous post I described the first version of the multilanguage database used on this website. For every table that has fields that must translated, we add a 'translation' table with these fields. I also implemented language fallback: if an item, like a blog post, does not exist in the selected language then the item of the (system-wide) default language is shown. This works fine but now I want ...
Read more
25 August 2019 Updated 30 August 2019 by Peter
post main image
When I started this project, this website, I kept in mind that it had to support multiple languages. But of course I did not really look into database design because of all the other things I had to learn, add and implement. After a certain moment I could display and select multiple languages but that was for the texts in the code and templates and not for the database content items like blog posts ...
Read more
14 August 2019 Updated 14 August 2019 by Peter
post main image
This post is about editing code, a lot of editing, huge amounts of editing! When you implement much functionality, you notice things that need attention, things that need you to research, how do others do this, what is the plural of certain words, etc. I maintain a todo list and every time I noticed something that needed attention I added it to this list. The list got too big so I decided to stop adding ...
Read more
7 August 2019 Updated 30 August 2019 by Peter
post main image
With a single language there is not really a problem, we just forget about the rest of the world and build our single language Flask application. We start getting a headache when the website must support multiple languages. What exactly is a website supporting multiple languages? How many languages will be supported, and which languages? For English there are for example en-GB and en-US. Which parts ...
Read more