Updated README + some small fixes
This commit is contained in:
parent
33c6731be0
commit
ce50960fb5
69
README.md
69
README.md
|
@ -1,28 +1,65 @@
|
||||||
|
# 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
|
||||||
|
```
|
||||||
|
|
||||||
|
Move to project directory and write:
|
||||||
|
```shell
|
||||||
|
flask run
|
||||||
|
```
|
||||||
|
|
||||||
|
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`)
|
||||||
|
|
||||||
|
Run new docker container:
|
||||||
|
```shell
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
# Translations
|
# Translations
|
||||||
## Create .pot file
|
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).
|
||||||
pybabel extract -F babel.cfg -o messages.pot .
|
|
||||||
|
|
||||||
## Create language .po files
|
## Install gettext
|
||||||
pybabel init -i messages.pot -d translations -l en
|
In order to use `msgmerge` command you have to install [gettext](https://www.gnu.org/software/gettext/).
|
||||||
pybabel init -i messages.pot -d translations -l sl
|
```shell
|
||||||
|
# Ubuntu command
|
||||||
|
sudo apt install gettext
|
||||||
|
```
|
||||||
|
|
||||||
## Compile changes
|
## Update translations commands
|
||||||
pybabel compile -d translations
|
|
||||||
|
|
||||||
## Update commands
|
|
||||||
Install gettext (sudo apt install gettext)
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
# Move to project directory
|
||||||
|
|
||||||
|
# Create .pot file
|
||||||
pybabel extract -F babel.cfg -o messages.pot .
|
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/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
|
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
|
pybabel compile -d translations
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Initiate a new language
|
||||||
|
If new language is introduced, you may use the following command:
|
||||||
# Deployment
|
```shell
|
||||||
docker build -t stark-web .
|
pybabel init -i messages.pot -d translations -l es
|
||||||
docker run -p 8080:8080 stark-web
|
```
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PROJECT VERSION\n"
|
"Project-Id-Version: PROJECT VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\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"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -172,6 +172,10 @@ msgstr ""
|
||||||
msgid "stark_credits3"
|
msgid "stark_credits3"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/about.html:19
|
||||||
|
msgid "stark_contact"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: templates/base.html:23
|
#: templates/base.html:23
|
||||||
msgid "switch_link"
|
msgid "switch_link"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -115,6 +115,10 @@ td {
|
||||||
width: 80%;
|
width: 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.narrower-container {
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
|
|
||||||
.redcjvt {
|
.redcjvt {
|
||||||
background-color: #e12a26;
|
background-color: #e12a26;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container">
|
<div class="container narrower-container">
|
||||||
<br>
|
<br>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col s12">
|
<div class="col s12">
|
||||||
|
@ -14,6 +14,9 @@
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
{{ _('stark_credits') }}<a target="_blank" href="https://spot.ff.uni-lj.si/">{{ _('SPOT: A Treebank-Driven Approach to the Study of Spoken Slovenian') }}</a>{{ _('stark_credits2') }}<a target="_blank" href="https://github.com/clarinsi/STARK">https://github.com/clarinsi/STARK</a>{{ _('stark_credits3') }}
|
{{ _('stark_credits') }}<a target="_blank" href="https://spot.ff.uni-lj.si/">{{ _('SPOT: A Treebank-Driven Approach to the Study of Spoken Slovenian') }}</a>{{ _('stark_credits2') }}<a target="_blank" href="https://github.com/clarinsi/STARK">https://github.com/clarinsi/STARK</a>{{ _('stark_credits3') }}
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
{{ _('stark_contact') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Binary file not shown.
|
@ -7,7 +7,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PROJECT VERSION\n"
|
"Project-Id-Version: PROJECT VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\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"
|
"PO-Revision-Date: 2024-02-14 14:36+0100\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: en <LL@li.org>\n"
|
"Language-Team: en <LL@li.org>\n"
|
||||||
|
@ -196,6 +196,10 @@ msgstr ""
|
||||||
msgid "stark_credits3"
|
msgid "stark_credits3"
|
||||||
msgstr "."
|
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
|
#: templates/base.html:23
|
||||||
msgid "switch_link"
|
msgid "switch_link"
|
||||||
msgstr "?lang=sl"
|
msgstr "?lang=sl"
|
||||||
|
|
Binary file not shown.
|
@ -6,7 +6,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PROJECT VERSION\n"
|
"Project-Id-Version: PROJECT VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\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"
|
"PO-Revision-Date: 2024-02-14 14:36+0100\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: sl <LL@li.org>\n"
|
"Language-Team: sl <LL@li.org>\n"
|
||||||
|
@ -197,6 +197,10 @@ msgstr ""
|
||||||
msgid "stark_credits3"
|
msgid "stark_credits3"
|
||||||
msgstr ") nekoliko poenostavljen nabor nastavitev."
|
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
|
#: templates/base.html:23
|
||||||
msgid "switch_link"
|
msgid "switch_link"
|
||||||
msgstr "?lang=en"
|
msgstr "?lang=en"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user