From d3ed905c1167b742b56dd2d4df9ca613b8b66117 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Mon, 3 Oct 2016 13:41:14 +0200 Subject: [PATCH] Lang fr ou en --- README.md | 18 ++++++++++++++++++ check_process | 3 ++- conf/lang_mypads.sql | 1 + conf/settings.json | 2 +- manifest.json | 27 ++++++++++++++++++--------- scripts/install | 15 +++++++++++---- 6 files changed, 51 insertions(+), 15 deletions(-) create mode 100644 conf/lang_mypads.sql diff --git a/README.md b/README.md index edb29d4..2f0278b 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,21 @@ Le script installe les paquets *npm* et *nodejs-legacy*, ainsi que *abiword* si sudo yunohost app upgrade --verbose etherpad_mypads -u https://github.com/YunoHost-Apps/etherpad_mypads_ynh **Multi-utilisateur:** Oui, sans support ldap. + +Ce package etherpad intègre les plugins suivant: + +- ep_align - *Add Left/Center/Right/Justify to lines of text in a pad* +- ep_author_hover - *Adds author names to span titles* +- ep_automatic_logut - *Automatically disconnects user after some period of time (Prevent server overload)* +- ep_comments_page - *Adds comments on sidebar and link it to the text.* +- ep_countable - *Displays paragraphs, sentences, words and characters counts.* +- ep_delete_empty_pads - *Delete pads which were never edited* +- ep_font_color - *Apply colors to fonts* +- ep_headings2 - *Adds heading support to Etherpad Lite.* +- ep_markdown - *Edit and Export as Markdown in Etherpad* +- ep_mypads - *Groups and private pads for etherpad* +- ep_page_view - *Add support to do 'page view', with a toggle on/off option in Settings, also Page Breaks with Control Enter* +- ep_spellcheck - *Add support to do 'Spell checking'* +- ep_subscript_and_superscript - *Add support for Subscript and Superscript* +- ep_table_of_contents - *View a table of contents for your pad* +- ep_user_font_size - *User Pad Contents font size can be set in settings, this does not effect other peoples views* diff --git a/check_process b/check_process index 8870162..b5aa994 100644 --- a/check_process +++ b/check_process @@ -3,8 +3,9 @@ ; Manifest domain="domain.tld" (DOMAIN) admin="john" (USER) - is_public="Yes" (PUBLIC|public=Yes|private=No) password="pass" (PASSWORD) + language="en" + is_public="Yes" (PUBLIC|public=Yes|private=No) abiword="0" ; Checks pkg_linter=1 diff --git a/conf/lang_mypads.sql b/conf/lang_mypads.sql new file mode 100644 index 0000000..f82f5a0 --- /dev/null +++ b/conf/lang_mypads.sql @@ -0,0 +1 @@ +UPDATE `store` SET `value`="__LANGUAGE__" WHERE `key`="mypads:conf:defaultLanguage" diff --git a/conf/settings.json b/conf/settings.json index af0f014..505b6bf 100644 --- a/conf/settings.json +++ b/conf/settings.json @@ -58,7 +58,7 @@ "rtl": false, "alwaysShowChat": false, "chatAndUsers": false, - "lang": "en-gb", + "lang": "__LANGUAGE__", // Plugins config // ep_automatic_logut diff --git a/manifest.json b/manifest.json index 4773606..b0cbe4a 100644 --- a/manifest.json +++ b/manifest.json @@ -41,15 +41,6 @@ }, "example": "john" }, - { - "name": "is_public", - "ask": { - "en": "Is it a public website?", - "fr": "Est-ce un site public ?" - }, - "choices": ["Yes", "No"], - "default": "Yes" - }, { "name": "password", "type": "password", @@ -59,6 +50,24 @@ }, "example": "Choose a password" }, + { + "name": "language", + "ask": { + "en": "Choose your language", + "fr": "Choisissez la langue" + }, + "choices" : ["en", "fr"], + "default" : "en" + }, + { + "name": "is_public", + "ask": { + "en": "Is it a public website?", + "fr": "Est-ce un site public ?" + }, + "choices": ["Yes", "No"], + "default": "Yes" + }, { "name": "abiword", "type": "boolean", diff --git a/scripts/install b/scripts/install index 60e4395..926bd17 100644 --- a/scripts/install +++ b/scripts/install @@ -12,10 +12,12 @@ TRAP_ON # Active trap pour arrêter le script si une erreur est détectée. # Retrieve arguments domain=$YNH_APP_ARG_DOMAIN admin=$YNH_APP_ARG_ADMIN -is_public=$YNH_APP_ARG_IS_PUBLIC password=$YNH_APP_ARG_PASSWORD +language=$YNH_APP_ARG_LANGUAGE +is_public=$YNH_APP_ARG_IS_PUBLIC abiword=$YNH_APP_ARG_ABIWORD + app=$YNH_APP_INSTANCE_NAME # Source app helpers @@ -108,6 +110,7 @@ then abiword_path=`which abiword` # Récupère l'emplacement de l'exécutable de abiword sudo sed -i "s@\"abiword\" : null@\"abiword\" : \"$abiword_path\"@" "$final_path/settings.json" # Renseigne l'emplacement de abiword dans la config de etherpad fi +sudo sed -i "s/__LANGUAGE__/$language/g" "$final_path/settings.json" STORE_MD5_CONFIG "settings.json" "$final_path/settings.json" # Enregistre la somme de contrôle du fichier de config STORE_MD5_CONFIG "credentials.json" "$final_path/credentials.json" # Enregistre la somme de contrôle du fichier de config @@ -135,7 +138,7 @@ sudo yunohost service add $app.service --log "/var/log/$app/etherpad.log" # Installation des plugins etherpad (Framapad style) -# script_dir="$PWD" +script_dir="$PWD" cd "$final_path" sudo npm install ep_align >> $install_log 2>&1 # Add Left/Center/Right/Justify to lines of text in a pad sudo npm install ep_author_hover >> $install_log 2>&1 # Framapad - Adds author names to span titles @@ -184,8 +187,8 @@ sudo service nginx reload sudo yunohost app ssowatconf # Surveille le démarrage du service. -for i in `seq 1 20` -do # La boucle attend le démarrage d'etherpad. Ou 20 secondes. Cette boucle évite simplement un 502 au début, car le démarrage est long... +for i in `seq 1 30` +do # La boucle attend le démarrage d'etherpad. Ou 30 secondes. Cette boucle évite simplement un 502 au début, car le démarrage est long... if grep -q "You can access your Etherpad instance at" "$tempfile"; then break # Si le log annonce le démarrage d'etherpad, sort de la boucle. fi @@ -194,3 +197,7 @@ do # La boucle attend le démarrage d'etherpad. Ou 20 secondes. Cette boucle év done kill -s 15 $PID_TAIL > /dev/null # Arrête l'exécution de tail. sudo rm "$tempfile" + +# Change la langue de mypads +sudo sed -i "s/__LANGUAGE__/$language/g" "$script_dir/../conf/lang_mypads.sql" +mysql -u $db_user -p$db_pwd $db_user < "$script_dir/../conf/lang_mypads.sql"