You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been successfully using meta-tags to handle i18n in the sense that for a given page, my application controller knows the locale and displays it in the right language. So are my meta tags.
Here is a simple example of my PagesController:
classPagesController < ApplicationControllerdefhomeset_meta_tags(title: _("Home"),description: _("This is my Home description."),image_src: request.base_url + ActionController::Base.helpers.image_path(_("og_image_en.png")),index: true,og: {type: "website",url: request.original_url,title: _("My website"),description: _("This is my Home description."),image: request.base_url + ActionController::Base.helpers.image_path(_("og_image_en.png"))})endend
My home page is routed via /, but also, I handle my locales via the URL this way: https://mydomain.com/fr. Here is how my router works:
Hello,
I have been successfully using
meta-tags
to handle i18n in the sense that for a given page, my application controller knows the locale and displays it in the right language. So are mymeta
tags.Here is a simple example of my
PagesController
:My home page is routed via
/
, but also, I handle my locales via the URL this way:https://mydomain.com/fr
. Here is how my router works:meta
tags work well in all languages forhttps://mydomain.com/
https://mydomain.com/:locale
, even if that is the same pageAny recommendation would help, thank you!
The text was updated successfully, but these errors were encountered: