Skip to content

Ἑρμῆς — Olympus Hermes Translator is a bundle used to translate all messages from your WordPress website, its plugins and Olympus bundles.

License

Notifications You must be signed in to change notification settings

GetOlympus/Hermes-Translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Olympus Hermes Translator

Olympus Hermes Translator is a bundle used to translate all messages from your WordPress website, its plugins and Olympus bundles.

composer require getolympus/olympus-hermes-translator

Olympus Component CodeFactor Grade Packagist Version MIT


Features

  • Better and secure folder structure
  • Dependency management with Composer

With Composer

How to

You can easily use the Hermes translator thanks to its functions:

namespace MyCustomPackage;

use GetOlympus\Hermes\Hermes;

/**
 * Load translations.
 *
 * @param  array   $translations
 * @param  string  $locale
 */
Hermes::l([
    'my-custom-domain' => '/absolute/path/to/custom/domain/directory/languages',
    'my-other-domain'  => '/absolute/path/to/other/domain/directory/languages',
    'my-latest-domain' => '/absolute/path/to/latest/domain/directory/languages',
    // (...)
], 'en_US');

/**
 * Noop typo from WordPress.
 *
 * @param  string  $single
 * @param  string  $plural
 * @param  integer $number
 * @param  string  $domain
 *
 * @return string
 */
echo Hermes::n('%s message', '%s messages', 3, 'my-custom-domain');

/**
 * Prepare noop typo from WordPress.
 *
 * @param  string  $single
 * @param  string  $plural
 *
 * @return string
 */
echo Hermes::noop('My %s uniq message', 'My %s messages', 'my-custom-domain');

/**
 * Translate typo.
 *
 * @param  string  $message
 * @param  string  $domain
 *
 * @return string
 */
echo Hermes::t('My custom message to translate', 'my-custom-domain');

Release History

See CHANGELOG.md for all details.

Contributing

  1. Fork it (https://github.com/GetOlympus/Hermes-Translator/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Built with ♥ by Achraf Chouk ~ (c) since a long time.

About

Ἑρμῆς — Olympus Hermes Translator is a bundle used to translate all messages from your WordPress website, its plugins and Olympus bundles.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages