Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imposible to use i18n #1371

Open
aksld opened this issue Jan 18, 2021 · 5 comments
Open

Imposible to use i18n #1371

aksld opened this issue Jan 18, 2021 · 5 comments

Comments

@aksld
Copy link

aksld commented Jan 18, 2021

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
/

@dextertd
Copy link

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/

@Spenhouet
Copy link

Spenhouet commented May 21, 2022

@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
Copy link

Spenhouet commented May 21, 2022

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
Copy link

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

@MikeRalphson
Copy link
Contributor

@aksld does the above solve your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@MikeRalphson @aksld @Spenhouet @dextertd and others