slate icon indicating copy to clipboard operation
slate copied to clipboard

Imposible to use i18n

Open aksld opened this issue 3 years ago • 5 comments

Hello,

It's imposible to use i18n.

My structure :

  • locales
    • en.yml
    • fr.yml
  • source/localizable
    • index.html.md

In my config.rb I add : activate :i18n

After run docker :

File Not Found /

aksld avatar Jan 18 '21 15:01 aksld

Hi I'm using i18n and have my index files using .html.erb suffix.

Here's what I followed when implementing i18n: https://middlemanapp.com/advanced/localization/

dextertd avatar Feb 19 '21 11:02 dextertd

@aksld Did you find a solution? I'm running into the same issue.

I adjusted the Docker serve commands to also include the locales, config.rb and other files.:

docker run --rm --name slate -p 4567:4567 -v $(pwd):/srv/slate slatedocs/slate serve

The output in the build directory looks fine. Also it deploys just fine via GitHub pages. Just on serve I get image

Changing the index.html.md to .html.erb as @dextertd suggested did not help.

It does not show any errors. So I have nothing to go by at the moment.

Spenhouet avatar May 21 '22 15:05 Spenhouet

Okay, I found my issue.

In the config.rb I did put the i18n config within the configure :build do without thinking about it. This made i18n only work on build but not on serve.

I did put the config now between those lines:

set :relative_links, true

# Internationalization support
activate :i18n, :mount_at_root => false
redirect "index.html", :to => "en/index.html"

# Build Configuration
configure :build do

Now it works.

Spenhouet avatar May 21 '22 15:05 Spenhouet

I have my version with internationalization fully working available here: https://github.com/Spenhouet/beautiful-docs I hope this helps.

Spenhouet avatar May 21 '22 23:05 Spenhouet

@aksld does the above solve your issue?

MikeRalphson avatar Aug 26 '22 14:08 MikeRalphson