scoobydam/php-translator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

scoobydam/php-translator

Composer 安装命令:

composer require scoobydam/php-translator

包简介

Simple and easy to use PHP translator using key => value system

README 文档

README

Codacy Badge

This library permits you to easily create translations for PHP scripts and apps.

Prerequisites

  • PHP >= 7.3

Install

You can install the package with git clone and composer install in the directory.

Or you can directly use composer :

composer require scoobydam/php-translator

Use

This library is an easy-to-use and light one.

use ScoobyTranslator\Translator\Translator;

$translator = new Translator(__DIR__ . '/translations', 'fr');
$translator->translate('key_to_translate');

This example will search for a fr.php file in the dir you passed the path in the first parameter.
This file might be like following

<?php
// __DIR__/translations/fr.php

$translations = [
    'general' => [
        'key' => 'value',
    ],
];

It needs to define the $translations variable and at least the general context key.

Full documentation

To know all what you can do, you can find full documentation here.

Contributions

You can send PRs if you want to :)

Just, please, follow these conventions.

统计信息

  • 总下载量: 193
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-05-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固