From ce50960fb5623beb680b6a89c213e2a6570ce06b Mon Sep 17 00:00:00 2001 From: lkrsnik Date: Wed, 13 Mar 2024 11:07:17 +0100 Subject: [PATCH] Updated README + some small fixes --- README.md | 69 ++++++++++++++++++------ messages.pot | 6 ++- static/css/style.css | 4 ++ templates/about.html | 5 +- translations/en/LC_MESSAGES/messages.mo | Bin 5524 -> 5677 bytes translations/en/LC_MESSAGES/messages.po | 6 ++- translations/sl/LC_MESSAGES/messages.mo | Bin 7021 -> 7147 bytes translations/sl/LC_MESSAGES/messages.po | 6 ++- 8 files changed, 76 insertions(+), 20 deletions(-) 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 6129ec91ce4e30270a0b3996019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rm z`rVV*!omVhSD1|>MX(5qwNV^(2U<~;>q4Dy$j1dFXS;?qIF39vNuz_#`gkrv{k7nc zPrO9kfmgn8#r^26qE7Y&$;sAHC*DLQSjA=v97WxM2IQ3`QR~}LcPQiUb2Zdo8}>4> z2M4hS$J}R_X8a9@F+sE(Uc@3kMr|Bp6YZ0vQ9}Dr^G8v4AdjlhX>7u?s7hWh(W#^} ziOP5i^-ZUJ!4m2YETitg4{XB@uCngHDb)H)s5|fg7w`kd`E<8y&A{#v?IxZ3*vGhz yGQY*WLv-@IXyk(`^O1VWh@;qoSL@5^;9W2iRR0WhcIP^el!Ng1Q2BE0Qs@tKdRgQE 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 5cd111cbd35c9934727a25e371dd028c11e3ce6d..3365c7a13ba9d71eb763c7fbbc224a1411ff1a19 100644 GIT binary patch delta 1541 zcmYM!TS!zv9LMpobTv1-XliNE3A7@-Mp|i>RvJV-NJMlIIl5ZAZF`n=wdlgq#h^fX z=mJ?Ufe0C7v_$w+P!SjrMGp}b5%mzE5tKay)%TYJE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%4bRuEgjFniAr;s7+GwT207pi><_o0)> zLA_sy>K8_uMC_P*aSoMKoi4tI+W8CTYg|qI7FmlWF-soiVhL7ZIqpYYWjE&IO)SKB zxE?*hSh8-!6V_;Uh{Ahb{Klnf$ORrJsk~fNGjVGc8I0dBgZk?vh$iUGjwRh=)ZIQu nCEEZhhsLl01JOOct?|+RKuw&lxU9T59L-NY;E(\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"