コード例 #1
0
ファイル: Translate.php プロジェクト: woshilapin/FreshRSS
 /**
  * Inclus le fichier de langue qui va bien
  * l'enregistre dans $translates
  */
 public static function init()
 {
     $l = Minz_Configuration::language();
     self::$language = Minz_Session::param('language', $l);
     $l_path = APP_PATH . '/i18n/' . self::$language . '.php';
     if (file_exists($l_path)) {
         self::$translates = (include $l_path);
     }
 }
コード例 #2
0
ファイル: install.php プロジェクト: buggithubs/FreshRSS
function printStep0()
{
    $actual = Minz_Translate::language();
    $languages = Minz_Translate::availableLanguages();
    ?>
	<?php 
    $s0 = checkStep0();
    if ($s0['all'] == 'ok') {
        ?>
	<p class="alert alert-success"><span class="alert-head"><?php 
        echo _t('gen.short.ok');
        ?>
</span> <?php 
        echo _t('install.language.defined');
        ?>
</p>
	<?php 
    }
    ?>

	<form action="index.php?step=0" method="post">
		<legend><?php 
    echo _t('install.language.choose');
    ?>
</legend>
		<div class="form-group">
			<label class="group-name" for="language"><?php 
    echo _t('install.language');
    ?>
</label>
			<div class="group-controls">
				<select name="language" id="language" tabindex="1" >
				<?php 
    foreach ($languages as $lang) {
        ?>
				<option value="<?php 
        echo $lang;
        ?>
"<?php 
        echo $actual == $lang ? ' selected="selected"' : '';
        ?>
>
					<?php 
        echo _t('gen.lang.' . $lang);
        ?>
				</option>
				<?php 
    }
    ?>
				</select>
			</div>
		</div>

		<div class="form-group form-actions">
			<div class="group-controls">
				<button type="submit" class="btn btn-important" tabindex="2" ><?php 
    echo _t('gen.action.submit');
    ?>
</button>
				<button type="reset" class="btn" tabindex="3" ><?php 
    echo _t('gen.action.cancel');
    ?>
</button>
				<?php 
    if ($s0['all'] == 'ok') {
        ?>
				<a class="btn btn-important next-step" href="?step=1" tabindex="4" ><?php 
        echo _t('install.action.next_step');
        ?>
</a>
				<?php 
    }
    ?>
			</div>
		</div>
	</form>
<?php 
}