# -*- coding: utf-8 -*-
#
# Copyright (C) 2025 CERN.
# Copyright (C) 2025 KTH Royal Institute of Technology.
#
# Invenio-Jobs is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

#
# 1) Create message catalog:
#    $ python setup.py extract_messages
#    $ python setup.py init_catalog -l <lang>
#    $ python setup.py compile_catalog
# 2) Ensure project has been created on Transifex under the inveniosoftware
#    organisation.
# 3) Install the transifex-client
#    $ pip install transifex-client
# 4) Push source (.pot) and translations (.po) to Transifex
#    $ tx push -s -t
# 5) Pull translations for a single language from Transifex
#    $ tx pull -l <lang>
# 6) Pull translations for all languages from Transifex
#    $ tx pull -a

[main]
host = https://app.transifex.com

[o:inveniosoftware:p:invenio:r:invenio-jobs-messages]
file_filter = invenio_jobs/translations/<lang>/LC_MESSAGES/messages.po
source_file = invenio_jobs/translations/messages.pot
source_lang = en
type = PO


# Translate JavaScript strings
# 1) Navigate to the directory:
#    cd invenio_jobs/assets/semantic-ui/translations/invenio_jobs
# 2) Install i18n dev dependencies
#    npm install
# 3) (Optional) Add a new language manually
#    npm run init_catalog lang <lang>
#    npm run extract_messages
#    NOTE: Normally not needed, languages should be added in Transifex and pulled from there.
# 4) Extract translation keys/values
#    $ npm run extract_messages
# 5) Install the transifex-client
#    $ curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
# 6) (Optional) Push source (.pot) and translations (.po) to Transifex
#    Navigate to the root of the invenio_jobs repository
#    $ tx push -s -t
#    NOTE: this step can be omitted as adding new language
# 7) (Optional) Pull translations for a single language from Transifex
#    $ tx pull -l <lang>
# 8) Pull translations for all languages from Transifex
#    Navigate to the root of the invenio_jobs repository
#    $ tx pull -a
# 9) Compile .po files for all languages
#    Navigate back to the invenio_jobs/assets/semantic-ui/translations/invenio_jobs folder
#    $ npm run compile_catalog
# 10) Convert .po file for a single language
#    $ npm run compile_catalog lang <lang>

[o:inveniosoftware:p:invenio:r:invenio-jobs-messages-ui]
file_filter = invenio_jobs/assets/semantic-ui/translations/invenio_jobs/messages/<lang>/messages.po
source_file = invenio_jobs/assets/semantic-ui/translations/invenio_jobs/translations.pot
source_lang = en
type = PO
