laravel-localization icon indicating copy to clipboard operation
laravel-localization copied to clipboard

Language flags

Open janmoes96 opened this issue 4 years ago • 2 comments

I'm not sure if it's in your package, but is it possible to have language flag icons to change languages instead of text?

janmoes96 avatar Jun 30 '20 20:06 janmoes96

I think it's helpful.

https://github.com/mcamara/laravel-localization/pull/371#issuecomment-258438015

johnef avatar Oct 16 '20 22:10 johnef

I have worked around this issue by doing this

@foreach(LaravelLocalization::getSupportedLocales() as $localeCode => $properties)
      <a class="dropdown-item" rel="alternate" hreflang="{{ $localeCode }}"
                href="{{ LaravelLocalization::getLocalizedURL($localeCode, null, [], true) }}">
                       @if($properties['native'] == "English")
                        <i class="flag-icon flag-icon-gb"></i>
                      @elseif($properties['native'] == "العربية")
                        <i class="flag-icon flag-icon-sa"></i>
                      @endif
              {{ $properties['native'] }}
       </a>
@endforeach

I know it's not the best solution but I got what I need. 🤪

johnef avatar Oct 16 '20 22:10 johnef