mirror of
https://github.com/YunoHost-Apps/etherpad_mypads_ynh.git
synced 2024-09-03 18:36:09 +02:00
Lang fr ou en
This commit is contained in:
parent
392ecff8fd
commit
d3ed905c11
6 changed files with 51 additions and 15 deletions
18
README.md
18
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*
|
||||
|
|
|
@ -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
|
||||
|
|
1
conf/lang_mypads.sql
Normal file
1
conf/lang_mypads.sql
Normal file
|
@ -0,0 +1 @@
|
|||
UPDATE `store` SET `value`="__LANGUAGE__" WHERE `key`="mypads:conf:defaultLanguage"
|
|
@ -58,7 +58,7 @@
|
|||
"rtl": false,
|
||||
"alwaysShowChat": false,
|
||||
"chatAndUsers": false,
|
||||
"lang": "en-gb",
|
||||
"lang": "__LANGUAGE__",
|
||||
|
||||
// Plugins config
|
||||
// ep_automatic_logut
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue