-
-
Notifications
You must be signed in to change notification settings - Fork 39
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-language support #64
Comments
Implementing an interactive/a visual mode for the internalisation seems to be too complicated, I've decided to set up two sites with a link to the other in the header. Works fine. |
I think to get a real multi-language support, there should be a global setting, where you define your supported languages. then each Block (text, image, etc.) should reflect these settings and extend its input fields. here is some example from: `<@ if @{ %lang } != "de" @> <@ else @> Dieses Template verdeutlicht die Nutzung von Sessions, um eine multilinguale Website zu erstellen. Klicke auf einen der Buttons unten, um zwischen Englisch und Deutsch zu wechseln, oder die Spracheinstellung aus dem Session Array zu laden. Klicke auf den "Use Session Setting" Button, um zu sehen, dass die ausgewählte Sprache auch angezeigt wird, wenn die URL keinen "lang" Parameter hat. <@ end @>` and for example the basic "paragraph"-block:
use Automad\Core\Automad; defined('AUTOMAD') or die('Direct access not permitted!'); /**
combined with your approach this could look like this:
} |
The second alpha of Automad 2 has been released yesterday. You can enable the new language router in the system settings in order to serve pages based on a vistor's language. |
Thanks for this fantastic CMS. However, I would like to reopen the language support issue. The documentation on sessions still lacks a few precise hints on where to put the code.
Can I edit the main theme templates (like light/project) with the two blocks of code (see below)? Will this be reflected in the visual (hero and main) live editor, or can the content then only be changed through hard coding? And how do I ensure that multi-language options appear in the menu?
<@ if @{ ?lang } @> <@ set { %lang: @{ ?lang } } @> <@ end @>
<@ if @{ %lang } = 'de' and @{ textGerman } @> @{ textGerman | markdown } <@ else @> @{ textEnglish | markdown } <@ end @>
The text was updated successfully, but these errors were encountered: