Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

00f100/fcphp-i18n

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

00f100/fcphp-i18n

Internationalization i18n

Source
Packagist
Version
dev-master
Version published
Maintainers
1
Created
Source

FcPhp i18n

Build Status codecov Total Downloads

How to install

Composer:

$ composer require 00f100/fcphp-i18n

or add in composer.json

{
    "require": {
        "00f100/fcphp-i18n": "*"
    }
}

How to use

<?php

$default = 'pt-br';
$translate = [
    'pt-br' => [
        'My name is %s' => 'Meu nome é %s',
    ],
    'en' => [
        'My name is %s' => 'My name is %s',
    ],
    'es' => [
        'My name is %s' => 'Mi nombre és %s',
    ],
];
__i18n_configure($default, $translate);
$name = 'João';
$text = 'My name is %s';

// Print: Meu nome é João
echo __($text, $name);

// Print: Meu nome é João
echo _i18n_translate($text, $name);

FAQs

Package last updated on 04 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts