diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ed1495133..ee8f714ab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -108,6 +108,7 @@ pages: script: - mkdir public - mkdocs build + - cd docs/fr && mkdocs build - mv site/* public/ # Mix docs disabled because of https://github.com/elixir-lang/ex_doc/issues/1172 # - mix deps.get diff --git a/docker/tests/Dockerfile b/docker/tests/Dockerfile index caed50223..2e23c3956 100644 --- a/docker/tests/Dockerfile +++ b/docker/tests/Dockerfile @@ -1,11 +1,11 @@ FROM elixir:latest LABEL maintainer="Thomas Citharel " -ENV REFRESHED_AT=2020-08-10 +ENV REFRESHED_AT=2020-10-20 RUN apt-get update -yq && apt-get install -yq build-essential inotify-tools postgresql-client git curl gnupg xvfb libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 python3-pip cmake RUN curl -sL https://deb.nodesource.com/setup_12.x | bash && apt-get install nodejs -yq RUN npm install -g yarn wait-on RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN mix local.hex --force && mix local.rebar --force -RUN pip3 install mkdocs mkdocs-material pymdown-extensions pygments mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin +RUN pip3 install mkdocs mkdocs-material pymdown-extensions pygments mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude RUN curl https://dbip.mirror.framasoft.org/files/dbip-city-lite-latest.mmdb --output GeoLite2-City.mmdb -s && mkdir -p /usr/share/GeoIP && mv GeoLite2-City.mmdb /usr/share/GeoIP/ diff --git a/docs/administration/index.md b/docs/administration/index.md index f30ce63c9..834ff9944 100644 --- a/docs/administration/index.md +++ b/docs/administration/index.md @@ -12,9 +12,16 @@ ## Dependencies -Mobilizon requires Elixir, NodeJS and PostgreSQL among other things. +Mobilizon requires Elixir, NodeJS and PostgreSQL among other things. Prefer to install Elixir and NodeJS from their official repositories instead of your distribution's packages. -Installing dependencies depends on the system you're using. Follow the steps of the [dependencies guide](dependencies.md). +Recommended versions: + +* Elixir 1.8+ +* NodeJS 12+ +* PostgreSQL 11+ + +!!! important + Installing dependencies depends on the system you're using. Follow the steps of the [dependencies guide](dependencies.md) and come back to this page when done. ## Setup diff --git a/docs/fr/docs/index.md b/docs/fr/docs/index.md new file mode 100644 index 000000000..09258dfc5 --- /dev/null +++ b/docs/fr/docs/index.md @@ -0,0 +1,10 @@ +--- +title: Documentation de Mobilizon +--- + +Bienvenue sur la documentation de Mobilizon + +* [En apprendre plus à propos de Mobilizon](/about) (en anglais) +* Apprendre comment utiliser Mobilizon (pas encore écrit) +* [Apprendre à installer Mobilizon](/administration) (en anglais) +* [Apprendre à contribuer à Mobilizon](/contribute) (en anglais) diff --git a/docs/fr/mkdocs.yml b/docs/fr/mkdocs.yml new file mode 100644 index 000000000..a6bc3841e --- /dev/null +++ b/docs/fr/mkdocs.yml @@ -0,0 +1,42 @@ +site_name: Mobilizon +repo_name: "framasoft/mobilizon" +repo_url: "https://framagit.org/framasoft/mobilizon" +site_dir: "../../site/fr" +extra: + social: + - icon: "fontawesome/brands/twitter" + link: "https://twitter.com/joinmobilizon" +markdown_extensions: + - admonition + - codehilite + - footnotes + - meta + - toc: + permalink: true + - pymdownx.superfences + - pymdownx.magiclink + - pymdownx.smartsymbols + - pymdownx.tabbed + - pymdownx.tilde + - pymdownx.mark +plugins: + - search: + lang: ["fr"] + - git-revision-date-localized + - minify: + minify_html: true +theme: + name: "material" + language: "fr" + features: + - instant + - tabs + custom_dir: "../theme/" + palette: + primary: "amber" + accent: "deep purple" + scheme: slate + font: false + icon: + logo: material/calendar + repo: fontawesome/brands/gitlab diff --git a/docs/javascripts/redirect.js b/docs/javascripts/redirect.js new file mode 100644 index 000000000..6142dda3a --- /dev/null +++ b/docs/javascripts/redirect.js @@ -0,0 +1,18 @@ +const languages = ["fr"]; + +const navigatorLanguage = + window.navigator.userLanguage || window.navigator.language; + +let language; +if (languages.includes(navigatorLanguage)) { + language = navigatorLanguage; +} +const split = navigatorLanguage.split("-")[0]; +if (languages.includes(split)) { + language = split; +} +const url = new URL(window.location.href); +if (language && (url.pathname === "/" || url.pathname.startsWith("/use/"))) { + url.pathname = `/${language}${url.pathname}`; + window.location.replace(url); +} diff --git a/docs/theme/main.html b/docs/theme/main.html new file mode 100644 index 000000000..3aea8be21 --- /dev/null +++ b/docs/theme/main.html @@ -0,0 +1,7 @@ +{% extends "base.html" %} + +{% block site_meta %} + {% if page.is_homepage %} + + {% endif %} +{% endblock %} diff --git a/js/src/views/Settings/Preferences.vue b/js/src/views/Settings/Preferences.vue index 7e82a5c3b..876daa270 100644 --- a/js/src/views/Settings/Preferences.vue +++ b/js/src/views/Settings/Preferences.vue @@ -39,11 +39,12 @@ - {{ + {{ $t("Timezone detected as {timezone}.", { timezone: Intl.DateTimeFormat().resolvedOptions().timeZone, }) }} + {{ $t("Unable to detect timezone.") }} diff --git a/mkdocs.yml b/mkdocs.yml index 604f35beb..7a2f32751 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,5 @@ site_name: Mobilizon +site_url: "https://docs.joinmobilizon.org/" repo_name: "framasoft/mobilizon" repo_url: "https://framagit.org/framasoft/mobilizon" extra: @@ -23,6 +24,9 @@ plugins: - git-revision-date-localized - minify: minify_html: true + - exclude: + glob: + - fr/* theme: name: "material" features: @@ -37,3 +41,5 @@ theme: icon: logo: material/calendar repo: fontawesome/brands/gitlab +extra_javascript: + - javascripts/redirect.js