izzle/translation

Izzle 翻译库和类

0.3.1 2021-05-06 09:50 UTC

This package is auto-updated.

Last update: 2024-09-06 16:43:57 UTC


README

简单翻译库

安装

使用 npm

$ composer require izzle/translation

用法

use Izzle\Translation\Services\Translation;

// Init and load translation file
$translation = new Translation('paht_to_file.json');

// Translate
// Ex. { "global": { "hello": "Hello {0}" } }"
echo $translation->translate('global.hello', ['World']);

输出

Hello World

许可证

版权 (c) 2020-至今 Izzle

MIT 许可证