Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fizker/php-l10n
https://github.com/fizker/php-l10n
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/fizker/php-l10n
- Owner: fizker
- Created: 2012-09-29T19:55:47.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2012-09-29T20:14:06.000Z (about 12 years ago)
- Last Synced: 2024-04-14T18:05:30.684Z (7 months ago)
- Language: PHP
- Size: 105 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Language Loader
===============The purpose of this project is to deliver a simple, lazy-loading language
loader, which helps make localized php apps.It is designed to be data-source agnostic, but a file-system based
implementation will be included.All that is required of a sub-implementation is to override the loadTable
function, which will be called the first time a specific table is requested.Working with the FileLanguageLoader
-----------------------------------To see a live version, check the tests/integration folder, where it is used
in some integration tests.The following code snippet shows how to use the library:
get('table', 'key');
?>This will load the file `table.strings` from inside the `{root}/lang/pak/dir`
folder, and return the value for the key `key`.The folder containing the language files should be a flat directory, where
each file has the extension `.strings` and is named after the table wanted.[The file contents should follow the same syntax that Apple uses in Cocoa](http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Functions/Reference/reference.html#//apple_ref/c/macro/NSLocalizedStringFromTable).
Such a file might look like this:
"key" = "value";
"another key" = "another value";Running the tests
-----------------To run the unit tests, first run `install-tests`. Then simply running
`runTests.php` will execute the tests.