Skip to content

Commit

Permalink
move original gettext to smmoosavi/php-gettext-core
Browse files Browse the repository at this point in the history
  • Loading branch information
smmoosavi committed Oct 28, 2015
1 parent 0e339ee commit 861a39e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 608 deletions.
4 changes: 2 additions & 2 deletions .gitignore
@@ -1,2 +1,2 @@
.idea
vendor
vendor
composer.lock
10 changes: 3 additions & 7 deletions composer.json
Expand Up @@ -7,17 +7,13 @@
"email": "se.mo.moosavi@gmail.com"
}
],
"minimum-stability": "dev",
"require": {
"php": ">=5.3.0"
"php": ">=5.3.0",
"smmoosavi/php-gettext-core": "1.0.*"
},
"autoload": {
"psr-0": {
"smmoosavi": "src/"
},
"classmap": [
"src/gettext.php",
"src/streams.php"
]
}
}
}

1 comment on commit 861a39e

@apmuthu
Copy link

@apmuthu apmuthu commented on 861a39e Oct 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

php-gettext-master.zip
The above release contains all the composer files and the autoload ones as well.

Alternatively, the 3 php files can be included in a target script and used like:

<?php
// test if gettext extension is installed with php
// if (!function_exists("gettext")) echo "gettext is not installed\n";
// else echo "gettext is supported\n";

require_once 'streams.php';
require_once 'gettext.php';
require_once 'L10n.php';

use smmoosavi\util\gettext\L10n;

$locale = 'ta_IN';
$lang = 'ta';
L10n::init($lang, __DIR__ . "/locale/$locale/LC_MESSAGES/ta_IN.mo");


$a = (__('Logout'));
$b = (__('Main  Menu'));
?>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8"/>
	</head>
	<body>
<?php
echo $a;
echo "<br>\n";
echo $b;
?>
	</body>
</html>

Please sign in to comment.