diff --git a/README.md b/README.md index 1fe7901..a064bda 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,65 @@ -# Translations -## Create .pot file -pybabel extract -F babel.cfg -o messages.pot . +# About +This is a repository where you may access the code for [STARK-web](https://orodja.cjvt.si/stark/). + +# Running +Install required libraries using (we presume you have preinstalled python 3.8+): +```shell +pip install -r requirements +``` -## Create language .po files -pybabel init -i messages.pot -d translations -l en -pybabel init -i messages.pot -d translations -l sl +Move to project directory and write: +```shell +flask run +``` -## Compile changes -pybabel compile -d translations +To run project locally. + +# Deployment +Website is deployed on 'storitve' server. + +After connecting there, clone latest version of this repository to custom location. + +Move inside clone repository and build a docker image using the following command (adapt version by modifying cited `2024-01-01`): +```shell +docker build -t stark-web:2024-01-01_1 . +``` + +Move to the location with docker-compose.yml (`/opt/Docker/STARK-web/`) and adapt `docker-compose.yml` file to be a container of the latest image (in previous example this would be `image: stark-web:2024-01-01_1`) -## Update commands -Install gettext (sudo apt install gettext) +Run new docker container: +```shell +docker compose up -d +``` + + +# Translations +Translations are implemented using [flask-babel library](https://pypi.org/project/flask-babel/) (this should already be installed if you followed instructions in Running section). +## Install gettext +In order to use `msgmerge` command you have to install [gettext](https://www.gnu.org/software/gettext/). ```shell +# Ubuntu command +sudo apt install gettext +``` + +## Update translations commands + +```shell +# Move to project directory + +# Create .pot file pybabel extract -F babel.cfg -o messages.pot . msgmerge translations/sl/LC_MESSAGES/messages.po messages.pot -o translations/sl/LC_MESSAGES/messages.po msgmerge translations/en/LC_MESSAGES/messages.po messages.pot -o translations/en/LC_MESSAGES/messages.po -# check and delete fuzzy in .po files +# !Check and delete fuzzy in .po files + +# Compile changes pybabel compile -d translations ``` - - -# Deployment -docker build -t stark-web . -docker run -p 8080:8080 stark-web \ No newline at end of file +## Initiate a new language +If new language is introduced, you may use the following command: +```shell +pybabel init -i messages.pot -d translations -l es +``` \ No newline at end of file diff --git a/messages.pot b/messages.pot index 57d45c6..14c03a5 100644 --- a/messages.pot +++ b/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-03-13 09:03+0100\n" +"POT-Creation-Date: 2024-03-13 11:06+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -172,6 +172,10 @@ msgstr "" msgid "stark_credits3" msgstr "" +#: templates/about.html:19 +msgid "stark_contact" +msgstr "" + #: templates/base.html:23 msgid "switch_link" msgstr "" diff --git a/static/css/style.css b/static/css/style.css index 86318a2..924d5ad 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -115,6 +115,10 @@ td { width: 80%; } +.narrower-container { + width: 40%; +} + .redcjvt { background-color: #e12a26; } diff --git a/templates/about.html b/templates/about.html index 5411651..24572f6 100644 --- a/templates/about.html +++ b/templates/about.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% block content %} -
+

@@ -14,6 +14,9 @@

{{ _('stark_credits') }}{{ _('SPOT: A Treebank-Driven Approach to the Study of Spoken Slovenian') }}{{ _('stark_credits2') }}https://github.com/clarinsi/STARK{{ _('stark_credits3') }} +
+
+ {{ _('stark_contact') }}
diff --git a/translations/en/LC_MESSAGES/messages.mo b/translations/en/LC_MESSAGES/messages.mo index 6129ec9..beec15e 100644 Binary files a/translations/en/LC_MESSAGES/messages.mo and b/translations/en/LC_MESSAGES/messages.mo differ diff --git a/translations/en/LC_MESSAGES/messages.po b/translations/en/LC_MESSAGES/messages.po index 75a28a2..065b4f9 100644 --- a/translations/en/LC_MESSAGES/messages.po +++ b/translations/en/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-03-13 09:03+0100\n" +"POT-Creation-Date: 2024-03-13 10:26+0100\n" "PO-Revision-Date: 2024-02-14 14:36+0100\n" "Last-Translator: FULL NAME \n" "Language-Team: en \n" @@ -196,6 +196,10 @@ msgstr "" msgid "stark_credits3" msgstr "." +#: templates/about.html:19 +msgid "stark_contact" +msgstr "Should you have any additional questions or require assistance with the tool, please contact kaja.dobrovoljc@ff.uni-lj.si." + #: templates/base.html:23 msgid "switch_link" msgstr "?lang=sl" diff --git a/translations/sl/LC_MESSAGES/messages.mo b/translations/sl/LC_MESSAGES/messages.mo index 5cd111c..3365c7a 100644 Binary files a/translations/sl/LC_MESSAGES/messages.mo and b/translations/sl/LC_MESSAGES/messages.mo differ diff --git a/translations/sl/LC_MESSAGES/messages.po b/translations/sl/LC_MESSAGES/messages.po index e509c7f..6f5c721 100644 --- a/translations/sl/LC_MESSAGES/messages.po +++ b/translations/sl/LC_MESSAGES/messages.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-03-13 09:03+0100\n" +"POT-Creation-Date: 2024-03-13 10:26+0100\n" "PO-Revision-Date: 2024-02-14 14:36+0100\n" "Last-Translator: FULL NAME \n" "Language-Team: sl \n" @@ -197,6 +197,10 @@ msgstr "" msgid "stark_credits3" msgstr ") nekoliko poenostavljen nabor nastavitev." +#: templates/about.html:19 +msgid "stark_contact" +msgstr "Za dodatna vprašanja ali pomoč pri uporabi orodja se obrnite na kaja.dobrovoljc@ff.uni-lj.si." + #: templates/base.html:23 msgid "switch_link" msgstr "?lang=en"