forked from plume/documentation
Compare commits
140 Commits
@ -0,0 +1,86 @@
|
||||
require "pathname"
|
||||
|
||||
BUILD_DIR = Pathname("build")
|
||||
LOCALE_DIR = Pathname("trans")
|
||||
TRANS_DIR = Pathname("translate")
|
||||
PSEUDO_LANG = "ach-UG"
|
||||
|
||||
CROWDIN_SNIPPET = <<EOS
|
||||
|
||||
<script type="text/javascript">
|
||||
var _jipt = [];
|
||||
_jipt.push(['project', 'plume-docs']);
|
||||
_jipt.push(['escape', function() {
|
||||
window.location.href = 'https://joinplu.me';
|
||||
}]);
|
||||
</script>
|
||||
<script type="text/javascript" src="//cdn.crowdin.com/jipt/jipt.js"></script>
|
||||
EOS
|
||||
|
||||
class Pathname
|
||||
alias to_str to_s
|
||||
end
|
||||
|
||||
desc "Run all tasks"
|
||||
task :all => ["crowdin:upload", :wait_trans_updated, :deploy, :deploy_trans]
|
||||
|
||||
task :wait_trans_updated do
|
||||
sleep 30
|
||||
end
|
||||
|
||||
desc "Build site"
|
||||
task :build_site => [:build_base, "crowdin:download"] do
|
||||
LOCALE_DIR.glob("**/*.html").each do |html|
|
||||
dest = Pathname(html.to_path.sub(%r|#{LOCALE_DIR}/([^/]+)/trans|, "#{BUILD_DIR}/\\1"))
|
||||
next if dest.file?
|
||||
dest.parent.mkpath
|
||||
copy html, dest
|
||||
end
|
||||
end
|
||||
|
||||
task :build_base do
|
||||
sh "bundle", "exec", "middleman", "build"
|
||||
end
|
||||
|
||||
desc "Build site for translate.docs.joinplu.me"
|
||||
task :build_trans => "crowdin:download" do
|
||||
sh "bundle", "exec", "middleman", "build", "--build-dir", TRANS_DIR
|
||||
|
||||
(LOCALE_DIR/PSEUDO_LANG/"trans").glob("**/*.html").each do |html|
|
||||
doc = html.read
|
||||
doc.sub! "<head>", "<head>" + CROWDIN_SNIPPET
|
||||
dest = Pathname(html.to_path.sub(LOCALE_DIR/PSEUDO_LANG/"trans", TRANS_DIR))
|
||||
$stderr.puts "#{html} -> #{dest}"
|
||||
dest.write doc
|
||||
end
|
||||
end
|
||||
|
||||
task :build_trans_src do
|
||||
sh "bundle", "exec", "middleman", "build", "--build-dir", LOCALE_DIR
|
||||
end
|
||||
|
||||
desc "Deploy docs.joinplue.me"
|
||||
task :deploy => :build_site do
|
||||
sh "netlify", "deploy", "--site", "40419055-f669-42be-8d07-0c1dcc0dc24b", "--dir", BUILD_DIR, "--prod"
|
||||
end
|
||||
|
||||
desc "Deploy translate.docs.joinplue.me"
|
||||
task :deploy_trans => :build_trans do
|
||||
sh "netlify", "deploy", "--site", "2b1e232b-ac98-4680-9ab4-6d4eee0d84cb", "--dir", TRANS_DIR, "--prod"
|
||||
end
|
||||
|
||||
namespace :crowdin do
|
||||
desc "Download translations"
|
||||
task :download => :build_trans_src do
|
||||
sh "crowdin", "download"
|
||||
end
|
||||
|
||||
desc "Upload translation sources"
|
||||
task :upload => :build_trans_src do
|
||||
sh "crowdin", "upload", "sources"
|
||||
end
|
||||
|
||||
task :download_pseudo do
|
||||
sh "crowdin", "download", "--pseudo"
|
||||
end
|
||||
end
|
@ -0,0 +1,136 @@
|
||||
#
|
||||
# Your Crowdin credentials
|
||||
#
|
||||
"project_id" : "356119"
|
||||
"api_token_env": "CROWDIN_PERSONAL_TOKEN"
|
||||
"base_path" : "."
|
||||
"base_url" : "https://api.crowdin.com"
|
||||
|
||||
#
|
||||
# Choose file structure in Crowdin
|
||||
# e.g. true or false
|
||||
#
|
||||
"preserve_hierarchy": true
|
||||
|
||||
#
|
||||
# Files configuration
|
||||
#
|
||||
files: [
|
||||
{
|
||||
#
|
||||
# Source files filter
|
||||
# e.g. "/resources/en/*.json"
|
||||
#
|
||||
"source" : "/trans/**/*.html",
|
||||
|
||||
#
|
||||
# Where translations will be placed
|
||||
# e.g. "/resources/%two_letters_code%/%original_file_name%"
|
||||
#
|
||||
"translation" : "/trans/%locale%/%original_path%/%original_file_name%",
|
||||
|
||||
#
|
||||
# Files or directories for ignore
|
||||
# e.g. ["/**/?.txt", "/**/[0-9].txt", "/**/*\?*.txt"]
|
||||
#
|
||||
#"ignore" : [],
|
||||
|
||||
#
|
||||
# The dest allows you to specify a file name in Crowdin
|
||||
# e.g. "/messages.json"
|
||||
#
|
||||
#"dest" : "",
|
||||
|
||||
#
|
||||
# File type
|
||||
# e.g. "json"
|
||||
#
|
||||
#"type" : "",
|
||||
|
||||
#
|
||||
# The parameter "update_option" is optional. If it is not set, after the files update the translations for changed strings will be removed. Use to fix typos and for minor changes in the source strings
|
||||
# e.g. "update_as_unapproved" or "update_without_changes"
|
||||
#
|
||||
#"update_option" : "",
|
||||
|
||||
#
|
||||
# Start block (for XML only)
|
||||
#
|
||||
|
||||
#
|
||||
# Defines whether to translate tags attributes.
|
||||
# e.g. 0 or 1 (Default is 1)
|
||||
#
|
||||
# "translate_attributes" : 1,
|
||||
|
||||
#
|
||||
# Defines whether to translate texts placed inside the tags.
|
||||
# e.g. 0 or 1 (Default is 1)
|
||||
#
|
||||
# "translate_content" : 1,
|
||||
|
||||
#
|
||||
# This is an array of strings, where each item is the XPaths to DOM element that should be imported
|
||||
# e.g. ["/content/text", "/content/text[@value]"]
|
||||
#
|
||||
# "translatable_elements" : [],
|
||||
|
||||
#
|
||||
# Defines whether to split long texts into smaller text segments
|
||||
# e.g. 0 or 1 (Default is 1)
|
||||
#
|
||||
# "content_segmentation" : 1,
|
||||
|
||||
#
|
||||
# End block (for XML only)
|
||||
#
|
||||
|
||||
#
|
||||
# Start .properties block
|
||||
#
|
||||
|
||||
#
|
||||
# Defines whether single quote should be escaped by another single quote or backslash in exported translations
|
||||
# e.g. 0 or 1 or 2 or 3 (Default is 3)
|
||||
# 0 - do not escape single quote;
|
||||
# 1 - escape single quote by another single quote;
|
||||
# 2 - escape single quote by backslash;
|
||||
# 3 - escape single quote by another single quote only in strings containing variables ( {0} ).
|
||||
#
|
||||
# "escape_quotes" : 3,
|
||||
|
||||
#
|
||||
# Defines whether any special characters (=, :, ! and #) should be escaped by backslash in exported translations.
|
||||
# e.g. 0 or 1 (Default is 0)
|
||||
# 0 - do not escape special characters
|
||||
# 1 - escape special characters by a backslash
|
||||
#
|
||||
# "escape_special_characters": 0
|
||||
#
|
||||
|
||||
#
|
||||
# End .properties block
|
||||
#
|
||||
|
||||
#
|
||||
# Often software projects have custom names for the directories where translations are placed. crowdin-cli allows you to map your own languages to be understandable by Crowdin.
|
||||
#
|
||||
#"languages_mapping" : {
|
||||
# "two_letters_code" : {
|
||||
# "crowdin_language_code" : "local_name"
|
||||
# }
|
||||
#},
|
||||
|
||||
#
|
||||
# Does the first line contain header?
|
||||
# e.g. true or false
|
||||
#
|
||||
#"first_line_contains_header" : true,
|
||||
|
||||
#
|
||||
# for spreadsheets
|
||||
# e.g. "identifier,source_phrase,context,uk,ru,fr"
|
||||
#
|
||||
# "scheme" : "",
|
||||
}
|
||||
]
|
@ -0,0 +1,35 @@
|
||||
---
|
||||
af-ZA: Afrikaans
|
||||
ar-SA: العربية
|
||||
ca-ES: Català
|
||||
cs-CZ: Česky
|
||||
da-DK: Dansk
|
||||
de-DE: Deutsch
|
||||
el-GR: Ελληνικά
|
||||
en-US: English
|
||||
eo-UY: Esperanto
|
||||
es-ES: Español
|
||||
fa-IR: فارسی
|
||||
fi-FI: Suomi
|
||||
fr-FR: Français
|
||||
gl-ES: Galego
|
||||
he-IL: עברית
|
||||
hu-HU: Magyar
|
||||
it-IT: Italiano
|
||||
ja-JP: 日本語
|
||||
ko-KR: 한국어
|
||||
nl-NL: Nederlands
|
||||
no-NO: Norsk (bokmål)
|
||||
pl-PL: Polski
|
||||
pt-PT: Português
|
||||
ro-RO: Română
|
||||
ru-RU: Русский
|
||||
sat-IN: ᱥᱟᱱᱛᱟᱲᱤ
|
||||
si-LK: සිංහල
|
||||
sr-SP: Српски
|
||||
sv-SE: Svenska
|
||||
tr-TR: Türkçe
|
||||
uk-UA: Українська
|
||||
vi-VN: Việtnam
|
||||
zh-CN: 简体中文
|
||||
zh-TW: 繁體中文
|
@ -1,19 +1,16 @@
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://joinplu.me"><img src="/images/logo.svg" alt="Plume logo">Plume</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://contribute.joinplu.me/">Contribute</a>
|
||||
<% link_to "/index.html" do %><img src="/images/logo.svg" alt="Plume logo">Plume<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://github.com/Plume-org/Plume">Source code</a>
|
||||
<%= link_to "Contribute", "/contribute/index.html" %>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://riot.im/app/#/room/#plume:disroot.org">Chat room</a>
|
||||
<a href="https://git.joinplu.me/Plume/Plume">Source code</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://framavox.org/g/WK40YHMA/plume">Loomio group</a>
|
||||
<a href="https://matrix.to/#/#plume-blog:matrix.org">Chat room</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</nav>
|
||||
|
@ -0,0 +1,18 @@
|
||||
---
|
||||
title: Guide stylistique
|
||||
icon: flag
|
||||
summary: 'Guide stylistiques et recommendations pour la traduction de Plume en français'
|
||||
time: 2 minutes
|
||||
---
|
||||
|
||||
## Forme inclusive
|
||||
|
||||
- employer des [mots épicènes](https://fr.wikipedia.org/wiki/Mot_%C3%A9pic%C3%A8ne)
|
||||
- employer le point médian: `musicien·nes`, `motivé·es`
|
||||
|
||||
## Glossaire
|
||||
|
||||
- email: e-mail
|
||||
- feed: flux
|
||||
- tag: étiquette
|
||||
- token: jeton
|
Binary file not shown.
After Width: | Height: | Size: 4.7 KiB |
@ -1,3 +1,53 @@
|
||||
document.getElementById('menu').addEventListener('click', evt =>
|
||||
evt.target.parentElement.classList.toggle('show')
|
||||
)
|
||||
)
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
class LanguageSwitcher {
|
||||
constructor(element) {
|
||||
this.element = element;
|
||||
this.control = this.element.querySelector('[aria-haspopup]');
|
||||
const popupId = this.control.getAttribute('aria-controls');
|
||||
this.popup = document.getElementById(popupId);
|
||||
this.control.addEventListener('click', _ => {this.toggle();});
|
||||
}
|
||||
|
||||
get expanded() {
|
||||
return this.control.getAttribute('aria-expanded') === 'true';
|
||||
}
|
||||
|
||||
toggle() {
|
||||
if (this.expanded) {
|
||||
this.collapse();
|
||||
} else {
|
||||
this.expand();
|
||||
}
|
||||
}
|
||||
|
||||
expand() {
|
||||
if (this.expanded) return;
|
||||
this.control.setAttribute('aria-expanded', 'true');
|
||||
this.popup.setAttribute('aria-hidden', 'false');
|
||||
}
|
||||
|
||||
collapse() {
|
||||
if (! this.expanded) return;
|
||||
this.control.setAttribute('aria-expanded', 'false');
|
||||
this.popup.setAttribute('aria-hidden', 'true');
|
||||
}
|
||||
}
|
||||
|
||||
const languageSwitchers = [];
|
||||
for (const switcher of document.getElementsByClassName('language-switcher')) {
|
||||
languageSwitchers.push(new LanguageSwitcher(switcher));
|
||||
}
|
||||
|
||||
document.body.addEventListener('click', event => {
|
||||
if (languageSwitchers.some(ls => ls.element.contains(event.target))) {
|
||||
return;
|
||||
}
|
||||
for (const ls of languageSwitchers) {
|
||||
ls.collapse();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue