Jump to content

Recommended Posts


Hello everyone,

 

I have a portion of php code for managing 2 languages in a Dropdown

  and translated directly with the files fr_FR.po and en_GB.po with followed by the currency.

 

  - flags + French + €

 

My question is the following because I start and I would like to add 7 other languages.

 

Here's the code portion:


 



<section class="Footer-locales">
<div class="u-relative">
<div class="o-flux" data-toggle="dropdown">
<div class="o-flux-body">
<div class="c-input u-alignLeft dropdown-toggle" role="button" aria-haspopup="true" aria-expanded="false" aria-controls="locale-dropdown">
<input type="text" id="footerSelectLocale" class="c-input-field is-focused u-white-bg u-cursorPointer" value="<?php if($_SESSION['locale']=='en_GB'){ echo 'English';}else{echo 'Français';}?> <?php echo $currency['symbol'];?>" readonly="">
<label for="footerSelectLocale" class="c-input-label">
<span>Language</span>
</label>
</div>
</div>
</div>

<div id="locale-dropdown" class="Dropdown Dropdown--locales dropdown-menu NavigationMenu NavigationMenu--locales u-clearfix" style="width: 250px;">
<ul class="u-reset u-right">
<?php
if($_SESSION['locale']=='en_GB')
{
$currecy=select_query("SELECT * FROM currency_table WHERE language='fr_FR'")[0];
?>
<li>
<a data-lang="fr_FR" class="lang notranslate js-optInExcluded" rel="nofollow">
<img src="https://d1ovtcjitiy70m.cloudfront.net/vi-1/images/icons/flags/svg/fr.svg" alt="" aria-hidden="true" width="20" height="15">
French <?php echo $currecy['symbol'];?>
</a>
</li>
<?php
}
else
{
$currecy=select_query("SELECT * FROM currency_table WHERE language='en_GB'")[0];
?>
<li>
<a data-lang="en_GB" class="lang notranslate js-optInExcluded" rel="nofollow">
<img src="https://d1ovtcjitiy70m.cloudfront.net/vi-1/images/icons/flags/svg/gb.svg" alt="" aria-hidden="true" width="20" height="15">
English <?php echo $currecy['symbol'];?>
</a>
</li>
<?php
}
?>
</ul>
</div>


I hope you can give me some help

 

Thanks to all

Link to comment
https://forums.phpfreaks.com/topic/305123-to-implement-language-packs-in-php/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.