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

language not being set #55

Open
thedamon opened this issue Jun 19, 2015 · 7 comments
Open

language not being set #55

thedamon opened this issue Jun 19, 2015 · 7 comments

Comments

@thedamon
Copy link

I've copied the info in various working examples but I'm still getting The 'language' parameter is not defined. I'm not totally sure where I should be check it.. I'm not calling the language variable directly like in #35. it's just by virtue of calling the Handlebars i18n helper

My assemble (0.4.3) task looks like this:

assemble: {
  options: {
    flatten: true,
    data: '<%= config.app %>/data/**/*.{yml,json}',
    layout: 'default.hbs',
    layoutdir: '<%= config.app %>/templates/layouts/',
    partials: ['<%= config.app %>/templates/partials/**/*.hbs'],
  },
  pages: {
    files: {
      '.tmp/': ['<%= config.app %>/templates/pages/**/*.hbs']
    },
    options: {
      plugins: [
        'assemble-contrib-i18n',
        'assemble-contrib-permalinks'
      ],
      i18n: {
        languages: [
          'en',
          'fr'
        ],
        templates: [
          "<%= config.app %>/templates/pages/**/*.hbs"
        ]
      },
      permalinks: {
        structure: ':language/index.html'
      }
    }
  }
},

I have data\i18n\fr.yml and data\i18n\en.yml

But I think maybe I'm missing a step

@LaurentGoderre
Copy link
Contributor

Your grunt looks good. Do you have a repo I can look at?

@LaurentGoderre
Copy link
Contributor

Btw, what is this part for?

files: {
      '.tmp/': ['<%= config.app %>/templates/pages/**/*.hbs']
},

@thedamon
Copy link
Author

Not public code unfortunately. the files: option is the page assembly. without it, the assemble task runs but doesn't output any html files (could rename it in src/dest form.. same idea). .tmp is for the watch task. on build we move the files out to the build directory.

I used --verbose to go through, and it looks like it's getting the settings properly, but that data's getting lost somewhere in the assemble task

@thedamon
Copy link
Author

Here is the verbose log... it looks like it's trying to build things 3 times. I could see not needing that files section you pointed out, but it doesn't process any html without it. https://gist.github.com/thedamon/fdf485ad19db42859e69

@LaurentGoderre
Copy link
Contributor

What I do instead of the files: section is use the following src: "!*.*"

@thedamon
Copy link
Author

thedamon commented Jul 2, 2015

That fixed it. i18n.templates makes the pages.files/src redundant?

@LaurentGoderre
Copy link
Contributor

Yes, it's kind of a work around to create a dynamic list of files. The `src: :!." is also a workaround for the fact that assemble (pre 0.6 anyways) requires a source declaration to be present.

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

2 participants