Open MattIPv4 opened 4 years ago
Hello! I'd love to take a look at this one on stream tomorrow and work on the foundation for this. Seems like you've got a few problems to resolve here:
I'd like to complete 1. I would use params for 2. I'll build it so it can be swapped to a user config or domain later. I'll also ensure existing URLs don't change, so we don't break anyone's links, it'll just be extra params, and I'll set the default locale to 'EN'. For 3, I would set up a few templates to demonstrate how to translate, but then there should be separate issues for different sets of views. I cannot help with 4. 😄
If this all sounds good, let me know, if there are issues, definitely let me know.
I'm happy to chip in on 3. There are a few things to bear in mind with this, though:
home/index
- if you call t('.hello_world')
from in there, you're referring to the key en.home.index.hello_world
. This can be costly if you're not raising errors on failed lookups - if you decide to move home/index
to somewhere/else
, you'll also need to change from:en:
home:
index:
to:
en:
somewhere:
else:
. That can be easy to forget, and hard to catch unless you're raising errors for missed translations and testing that all your views render. Hope that's helpful!
Feature description
All strings show to the user within the app should be moved to i18n data.
This provides two key benefits: