DokuWiki

It's better when it's simple

User Tools

Site Tools


Sidebar

Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community


Follow us on Facebook, Twitter and other social networks.

Our Privacy Policy

teams:translate-tool

Translation Tool

Repository for Translate Tool Thingy

The commands used here are retrieved from .bash_history of the user translate. The documentation was done several years after the usage of them and might be incomplete. :!: Use your brain and read the logs :!:

Installation

:!: not complete see also README.md and use your brain :!:

  • checkout code from github:
    git clone https://github.com/...
  • install composer:
    export COMPOSER_PROCESS_TIMEOUT=3000
    composer.phar install
  • adapt configuration files
  • don't know what these do but were run on installation:
    php app/console assets:install --env=prod
    php app/console assetic:dump --env=prod

Update

Update are always needed when there is new code on github.

  • login to server
  • change to translate user:
    sudo -i
    su translate
    cd ~/htdocs
  • pull new code:
    git pull
  • if needed update dependencies:
    composer update
  • if there are changes to doctrine, update the schema:
    php app/console doctrine:schema:update
  • rebuilt cache of Symphony framework
  • if there are changes to the translation object LocalText, LanguageFileParser, etc which are cached by the translation tool:
    php app/console dokuwiki:updateLanguages

Configuration

:!: After every configuration change the cache has to be rebuild :!:

  • configuration for production:
    app/config/config_prod.yml
    imports:
        - { resource: config.yml }
     
    monolog:
        handlers:
            main:
                type:         fingers_crossed
                action_level: error
                handler:      nested
            nested:
                type:  stream
                path:  %kernel.logs_dir%/%kernel.environment%.log
                level: debug
     
    framework:
        trusted_hosts: ['.*\.?translate\.dokuwiki\.org$'
  • parameters for the application:
    app/config/parameters.yml
    parameters:
     
        # Database configuration - see
        database_driver: pdo_mysql
        database_host: localhost
        database_port: null
        database_name: translate
        database_user: xxxxxx
        database_password: xxxxxx
        database_path: null
     
        # E-Mail configuration - see http://symfony.com/doc/current/cookbook/email/email.html#configuration
        mailer_transport: smtp
        mailer_host: localhost
        mailer_user: null
        mailer_from: translate@dokuwiki.org
        mailer_password: null
     
        # Hash salt
        secret: xxxxx
     
        # path to the git executable
        git_bin: /usr/bin/git
     
        # path to the data folder (must be writeable)
        data: /var/www/translate/data
     
        # time since last update per repository (sec) 86400 -> 1day
        # reprositoryUpdateAge: 86400
        reprositoryUpdateAge: 7200
     
        # max repositories to update per command run
        maxRepositoriesToUpdatePerRun: 10
     
        # max number of import errors before ignoring a repository
        maxErrorCount: 3
     
        # max time a git command can run in sec
        command_timeout: 120
     
        # GitHub api token, see https://github.com/settings/applications
        git_hub_token: xxxxx
     
        # GitHub url
        # you can change this on a development environment to setup a second ssh key for a second git account without
        # messing up your environment - http://sampreshan.svashishtha.com/2012/05/20/quicktip-github-multiple-accounts-access-with-ssh/
        git_hub_url: github.com
     
        # Default locale. (there is just english)
        locale: en
     
        ## Feature flags
     
        featureImport: false
        featureAddTranslationFromDetail: false
     
        ## at path for symphony
        router.request_context.host: translate.dokuwiki.org
        router.request_context.scheme: http

Cache

  • login to server
  • rebuilt cache:
    sudo -i
    su translate
    cd ~/htdocs
    php app/console cache:clear --env=prod
    php app/console cache:warmup --env=prod

Plugin

delete

  • login to server
  • change to translate user:
    sudo -i
    su translate
  • delete repository:
    cd
    cd htdocs
    php app/console dokuwiki:deleteRepo plugin <pluginname>

Languages

delete

  • connect to database:
    mysql -p translate
  • list languages:
    SELECT code from languageName;
  • check whether which plugins use the language code:
    SELECT * FROM languageStats WHERE language='langCode';
  • delete all references between plugin and language code as languageStats.language is a foreign key to languageName.code:
    DELETE FROM languageStats WHERE language='langCode';
  • delete language based on language code:
    DELETE FROM languageName where code='langCode';

Troubleshooting

  • logfiles
    • /var/log/apache2/translate-access.log ⇒ apache access logs
    • /var/log/apache2/translate-error.log ⇒ apache error logs
    • DOC_ROOT/htdocs/app/logs/prod.log ⇒ application log for production environment
  • sometimes the plugin importer stuck
    • impacts
      • no updates of translations are push to github
      • no plugin updates are pulled from github
    • solution
      • login to server
      • change to translate user:
        sudo -i
        su translate
        cd ~/htdocs
      • remove lock file of update process:
        rm ../data/dokuwiki-importer.lock
      • run update job manually:
        php app/console dokuwiki:updateGit
      • check the log files
  • to get a list of possible options and commands for the console-app run:
    php app/console list
teams/translate-tool.txt · Last modified: 2018-01-03 14:43 by Klap-in