Skip to content

Commit

Permalink
added includeFunctions() method
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Mar 4, 2017
1 parent fc2c0d2 commit 9f8b059
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added

* Added support for named placeholders (using `strtr`). For example:

```php
__('Hello :name', [':name' => 'World']);
```
* Added support for Twig v2
* New function `BaseTranslator::includeFunctions()` to include the functions file without register any translator

### Fixed

Expand All @@ -22,4 +24,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

Previous releases are documented in [github releases](https://github.com/oscarotero/Gettext/releases)

[4.3.0]: https://github.com/oscarotero/Gettext/compare/v4.2.0...v4.3.0
[4.3.0]: https://github.com/oscarotero/Gettext/compare/v4.2.0...v4.3.0
Empty file modified README.md
100755 → 100644
Empty file.
10 changes: 9 additions & 1 deletion src/BaseTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@ public function register()

self::$current = $this;

include_once __DIR__.'/translator_functions.php';
static::includeFunctions();

return $previous;
}

/**
* Include the gettext functions
*/
public static function includeFunctions()
{
include_once __DIR__.'/translator_functions.php';
}
}

0 comments on commit 9f8b059

Please sign in to comment.