Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internationalization PSR #1259

Merged
merged 11 commits into from Dec 24, 2021
41 changes: 41 additions & 0 deletions proposed/internationalization-meta.md
@@ -0,0 +1,41 @@
# Internationalization Meta Document

## 1. Summary

Developers of components that are not coupled to any specific framework often find themselves in need of displaying a message to the user of the web application. However, being as they are not a component of a specific framework, their options for making these messages localizable is limited. In many cases, developers will make no attempt to pass these messages through a localization layer.

To resolve this issue and encourage the localization of libraries, a standard method for translating and transforming messages is necessary.

## 3. Scope

### 3.1. Goals

* Provide a method for an independent component to display a message in a language other than the one in which the component was written.

### 3.2. Non-Goals

* This PSR does not provide a standard for the storage and management of translatable items and their translations. That is, this PSR is about denoting that a _message is translatable_ - **not** providing the specific translations for it.
* This PSR does not provide a mechanism for collecting translatable items from a component's source code.
* This PSR only addresses text present in PHP code. It is not concerned with the translation of user content stored in a database or similar data store.

## 4. Approaches

To solve this, we currently aim to create an interface that a framework-independent component can rely on for transforming a message key and context into a translated and formatted string.

## 5. People

### 5.1. Editor
* Navarr Barnier

### 5.2. Sponsor
* Larry Garfield

### 5.3. Working group members
* Alexander Makarov
* Susanne Moog
* Ken Guest
* Ben Ramsey

## 6. Votes

* [Entrance Vote](https://groups.google.com/g/php-fig/c/AgzdtXS_iU0)
15 changes: 15 additions & 0 deletions proposed/internationalization.md
@@ -0,0 +1,15 @@
# Common Interfaces and Functionality for Interoperability of Message Translation and Formatting

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
"SHOULD NOT", "RECOMMEND", "MAY", and "OPTIONAL" in this document are to
interpreted as described in [RFC 2119][].

The final implementations MAY decorate the objects with more functionality than
covered in the recommendation however they MUST implement the indicated
interfaces and functionality first.

[RFC 2119]: http://tools.ietf.org/html/rfc2119

# 1. Specification

TBD.