05a6b63
SELinux translations currently live in the following locations:
05a6b63
05a6b63
- https://translate.fedoraproject.org/projects/selinux/
05a6b63
  - contains 2 versions of translatable strings rhel8 (latest RHEL 8 release) and main (Fedora and RHEL 9)
05a6b63
  - maintains large number of languages (several of which do not actually contain any translated strings)
05a6b63
  - updated by community and partially by RH localization effort
05a6b63
05a6b63
- SELinux source repositories (periodicaly updated from weblate)
05a6b63
  - https://github.com/fedora-selinux/selinux
05a6b63
    - used for Fedora, latest CentOS and RHEL 9
05a6b63
  - https://github.com/SELinuxProject/selinux
05a6b63
    - upstream repository
05a6b63
05a6b63
How to update source files on weblate:
05a6b63
  $ git clone git@github.com:fedora-selinux/selinux.git
05a6b63
  $ cd selinux
05a6b63
  # generate new potfiles
05a6b63
  $ for p in policycoreutils python gui sandbox; do
05a6b63
    cd $p/po
05a6b63
    rm $p.pot
05a6b63
    make $p.pot
05a6b63
    sed -i 's/charset=CHARSET/charset=UTF-8/g' $p.pot
05a6b63
    cd -
05a6b63
    done
05a6b63
  # https://translate.fedoraproject.org/projects/selinux/policycoreutils/en/
05a6b63
  # Files -> Upload translations
05a6b63
  # Repeat the process for python, gui and sandbox
05a6b63
  # or use weblate command line tool (get your API key at https://translate.fedoraproject.org/accounts/profile/#api):
05a6b63
  $ for p in policycoreutils python gui sandbox; do
05a6b63
    wlc --key <API key> --url https://translate.fedoraproject.org/api/ upload --input $p/po/$p.pot selinux/$p/en --method=source
05a6b63
    done
05a6b63
05a6b63
How to pull new translations from weblate
05a6b63
  $ git clone git@github.com:fedora-selinux/selinux.git
05a6b63
  # https://translate.fedoraproject.org/projects/selinux/policycoreutils
05a6b63
  # Files -> Download translation files as ZIP file (save in selinux source directory)
05a6b63
  # Repeat the process for python, gui and sandbox
05a6b63
  # or use weblate command line tool
05a6b63
  $ for p in policycoreutils python gui sandbox; do
05a6b63
    wlc --key <API key> --url https://translate.fedoraproject.org/api/ download selinux/$p --output selinux
05a6b63
    done
05a6b63
  # unzip archives
05a6b63
  $ cd selinux
05a6b63
  $ for p in policycoreutils python gui sandbox; do
05a6b63
    unzip -o selinux-$p.zip -d ..
05a6b63
    rm selinux-$p.zip
05a6b63
    done
05a6b63
  $ git add .
05a6b63
  $ git commit