Skip to content

Instantly share code, notes, and snippets.

@katzueno
Last active August 29, 2015 14:02
Show Gist options
  • Save katzueno/7ad9de5ce7f4be17d670 to your computer and use it in GitHub Desktop.
Save katzueno/7ad9de5ce7f4be17d670 to your computer and use it in GitHub Desktop.
Gettext, t() format
<?php
// Simple String
echo t('STRING');
// String with one variable
$string = 'name';
echo t('STRING %s', $string);
// String with more than 1 variables
$string1 = 'name 1';
$string2 = 'name 2';
echo t('STRING %$1 %$2', $string1, $string2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment