Skip to content

Commit

Permalink
Merge pull request #40 from lite-xl/i18n
Browse files Browse the repository at this point in the history
i18n
  • Loading branch information
takase1121 committed Feb 14, 2024
2 parents 5a96144 + 5772f9c commit db6bb7a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 18 deletions.
52 changes: 34 additions & 18 deletions locales/en/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,51 @@
<body>
<header>
<logo>
<a href='/en'><img class='logo' src='/assets/img/logo.svg'/></a>
<h2><a href='/en'>Lite XL</a></h2>
<a href='/{{ lang }}'><img class='logo' src='/assets/img/logo.svg'/></a>
<h2><a href='/{{ lang }}'>Lite XL</a></h2>
</logo>
<links>
<menu hidden="true">
<h2><a href="#">
<svg xmlns="http://www.w3.org/2000/svg" width="21" height="18"><defs><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="a"><stop stop-color="#FFF" offset="0%"/><stop stop-color="#F0F0F0" offset="100%"/></linearGradient><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="b"><stop stop-color="#D02F44" offset="0%"/><stop stop-color="#B12537" offset="100%"/></linearGradient><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="c"><stop stop-color="#46467F" offset="0%"/><stop stop-color="#3C3C6D" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path fill="url(#a)" d="M0 0h21v15H0z"/><path d="M0 0h21v1H0V0zm0 2h21v1H0V2zm0 2h21v1H0V4zm0 2h21v1H0V6zm0 2h21v1H0V8zm0 2h21v1H0v-1zm0 2h21v1H0v-1zm0 2h21v1H0v-1z" fill="url(#b)"/><path fill="url(#c)" d="M0 0h9v7H0z"/><path d="M1.5 2a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm-5 1a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm1 1a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm-2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm-2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm-2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm1 1a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm1 1a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm-2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm-2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm-2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1z" fill="url(#a)"/></g></svg>
EN
</a></h2>
<items>
<a href="/en/{{ path }}">
<svg xmlns="http://www.w3.org/2000/svg" width="21" height="18"><defs><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="a"><stop stop-color="#FFF" offset="0%"/><stop stop-color="#F0F0F0" offset="100%"/></linearGradient><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="b"><stop stop-color="#D02F44" offset="0%"/><stop stop-color="#B12537" offset="100%"/></linearGradient><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="c"><stop stop-color="#46467F" offset="0%"/><stop stop-color="#3C3C6D" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path fill="url(#a)" d="M0 0h21v15H0z"/><path d="M0 0h21v1H0V0zm0 2h21v1H0V2zm0 2h21v1H0V4zm0 2h21v1H0V6zm0 2h21v1H0V8zm0 2h21v1H0v-1zm0 2h21v1H0v-1zm0 2h21v1H0v-1z" fill="url(#b)"/><path fill="url(#c)" d="M0 0h9v7H0z"/><path d="M1.5 2a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm-5 1a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm1 1a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm-2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm-2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm-2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm1 1a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm1 1a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm-2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm-2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1zm-2 0a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1z" fill="url(#a)"/></g></svg>
English
</a>
<a href="/de/{{ path }}">
<svg xmlns="http://www.w3.org/2000/svg" width="21" height="18"><defs><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="a"><stop stop-color="#FFF" offset="0%"/><stop stop-color="#F0F0F0" offset="100%"/></linearGradient><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="b"><stop stop-color="#262626" offset="0%"/><stop stop-color="#0D0D0D" offset="100%"/></linearGradient><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="c"><stop stop-color="#F01515" offset="0%"/><stop stop-color="#DE0000" offset="100%"/></linearGradient><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="d"><stop stop-color="#FFD521" offset="0%"/><stop stop-color="#FFCF00" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path fill="url(#a)" d="M0 0h21v15H0z"/><path fill="url(#b)" d="M0 0h21v5H0z"/><path fill="url(#c)" d="M0 5h21v5H0z"/><path fill="url(#d)" d="M0 10h21v5H0z"/></g></svg>
Deutsch
</a>
</items>
</menu>
<menu>
<h2><a href='/en/about'>About</a></h2>
<h2><a href='/{{ lang }}/about'>About</a></h2>
<items>
<a href='/en/about/faq'>FAQ</a>
<a href='/en/about/features'>Features</a>
<a href='/en/about/screenshots'>Screenshots</a>
<a href='/en/about/contributors'>Contributors</a>
<a href='/{{ lang }}/about/faq'>FAQ</a>
<a href='/{{ lang }}/about/features'>Features</a>
<a href='/{{ lang }}/about/screenshots'>Screenshots</a>
<a href='/{{ lang }}/about/contributors'>Contributors</a>
</items>
</menu>
<menu>
<h2><a href='/en/documentation'>Documentation</a></h2>
<h2><a href='/{{ lang }}/documentation'>Documentation</a></h2>
<items>
<a href='/en/documentation/usage'>Usage</a>
<a href='/en/documentation/build'>Build</a>
<a href='/en/documentation/keymap'>Default Keymap</a>
<a href='/en/documentation/keymap-macos'>MacOS Keymap</a>
<a href='/{{ lang }}/documentation/usage'>Usage</a>
<a href='/{{ lang }}/documentation/build'>Build</a>
<a href='/{{ lang }}/documentation/keymap'>Default Keymap</a>
<a href='/{{ lang }}/documentation/keymap-macos'>MacOS Keymap</a>
</items>
</menu>
<menu>
<h2><a href='/en/tutorials'>Tutorials</a></h2>
<h2><a href='/{{ lang }}/tutorials'>Tutorials</a></h2>
<items>
<a href='/en/tutorials/simple-plugin'>Simple Plugin</a>
<a href='/en/tutorials/syntax-highlighting'>Syntax Highlighting</a>
<a href='/en/tutorials/api-overview'>API Overview</a>
<a href='/en/tutorials/system-fonts'>System Fonts</a>
<a href='/{{ lang }}/tutorials/simple-plugin'>Simple Plugin</a>
<a href='/{{ lang }}/tutorials/syntax-highlighting'>Syntax Highlighting</a>
<a href='/{{ lang }}/tutorials/api-overview'>API Overview</a>
<a href='/{{ lang }}/tutorials/system-fonts'>System Fonts</a>
</items>
</menu>
<h2><a target="_blank" href='https://github.com/lite-xl/lite-xl-plugins'>
Expand All @@ -49,7 +65,7 @@ <h2><a target="_blank" href='https://github.com/lite-xl/lite-xl-plugins'>
</svg>
Plugins
</a></h2>
<h2><a href='/en/downloads'>
<h2><a href='/{{ lang }}/downloads'>
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z" />
</svg>
Expand Down
2 changes: 2 additions & 0 deletions site.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def slugify(name)
.gsub("{{ page }}", contents)
.gsub("{{ title }}", title)
.gsub("{{ id }}", id)
.gsub("{{ lang }}", locale)
.gsub("{{ path }}", File.join(Pathname(basename).each_filename.map { |component| component == "index" ? "" : slugify(component) }))
File.write(root + target, contents)

if generateIndex
Expand Down

0 comments on commit db6bb7a

Please sign in to comment.