# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2021 CERN.
# Copyright (C) 2022-2023 Graz University of Technology.
#
# Invenio 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-communities-messages]
file_filter = invenio_communities/translations/<lang>/LC_MESSAGES/messages.po
source_file = invenio_communities/translations/messages.pot
source_lang = en
type = PO

# Translate JavaScript strings
# 1) Navigate to the invenio_communities/assets/semantic-ui/translations/invenio_communities/ folder
# 2) Install i18n dev dependencies
#    npm install
# 3) Add a new language
#    npm run init_catalog lang <lang>
# 4) Extract translation keys/values
#    $ npm run extract_messages
# 5) Update the ./messages/index.js file
#    import TRANSLATE_<lang> from './<lang>/translations.json'
#    export const translations = {
#      ...rest,
#      <lang>: { translation: TRANSLATE_<lang> }
#    }
# 6) Install the transifex-client
#    $ pip install transifex-client
# 7) Push source (.pot) and translations (.po) to Transifex
#    $ tx push -s -t
# 8) Pull translations for a single language from Transifex
#    $ tx pull -l <lang>
# 9) Pull translations for all languages from Transifex
#    $ tx pull -a
# 10) Compile .po files for all languages
#    $ npm run compile_catalog
# 11) Convert .po file for a single language
#    $ npm run compile_catalog lang <lang>

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