Comments (8)
Also, loading of the proper translated flavor of the site depending on user's settings would be awesome, but this is probably impossible with a static website. is it really ?
from prosopopee.
See https://www.flag-sprites.com/ for free flags with css code ready
from prosopopee.
with a small javascript snippet it should be possible to redirect to the user's language specific version of the page (more or less like simone does for yunohost doc ?)
from prosopopee.
See https://github.com/yunohost/yunohost-admin/blob/unstable/src%2Fjs%2Fyunohost%2Fmain.js#L111-L119
redirect in js with : document.location.href = "https://tonporn.com"
from prosopopee.
Jinja has a gettext extension : http://jinja.pocoo.org/docs/dev/extensions/#i18n-extension
This could probably help a lot, and decouple quite well localization functionnalities from the core of prosopopee.
I made an attempt with stuff like :
title:
fr: Salut
es: Ola
but I fear this will become complex to handle all the different text attributes of individual sections which all have a different data model (e.g. full-picture and text).
from prosopopee.
Regarding flags: I've been taugh that using flag is apparently bad for i18n and that language name or short name should be used instead.
from prosopopee.
An experiment i'm relatively happy with : https://gist.github.com/julienmalik/e6544ad26e82bae4381c
from prosopopee.
beginning of a solution here : https://github.com/julienmalik/prosopopee/tree/internationalization
it generates index.$lang.html for all langs if you put e.g. :
multilingual:
- fr
- es
in the root settings.yaml
to be multilingual the gallery .yaml then needs to be like :
title:
fr: Salut
es: Ola
but the monolingual case is still supported as before.
when generating a multilingual version, if a string is not translated (title: Hello
) then it is used for all languages.
multi langages are supported only for title, subtitle and text keys.
from prosopopee.
Related Issues (20)
- autogen silently omits some images HOT 1
- full-picture with space in filename does not render HOT 3
- video conversions fail with space in filename
- panorama broken since 729b946 HOT 1
- image currently in view is moved 50% down while lazy loading HOT 9
- Images in paragraph section are not scaled appropriately on mobile
- Requirements should be for `path` not `path.py` and then other errors HOT 3
- night_mode breaks site HOT 1
- Line height and image description don't look right on mobile
- autogen not working with my files HOT 7
- Weird thumbnail created for videos on mobile
- Large vertical bordered-pictures are too large on desktop
- 4K videos end up pixelated when the gallery is rendered
- ValueError: too many values to unpack (expected 2)
- Turning off the image captions on mouse over
- AttributeError: module 'jinja2.ext' has no attribute 'with_' HOT 3
- Vertical videos HOT 1
- Animated gifs HOT 1
- yaml options to be improved for latest python HOT 1
- AttributeError: 'NoneType' object has no attribute 'months'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prosopopee.