Finish the multilingual feature #2303

Closed
wants to merge 51 commits into
from

Projects

None yet
@bep
Collaborator
bep commented Jul 26, 2016 edited

This is currently slightly slower than master in a bench mark with 4 fairly big sites:

benchmark           old ns/op      new ns/op      delta
BenchmarkHugo-4     3146033049     3225819889     +2.54%

benchmark           old allocs     new allocs     delta
BenchmarkHugo-4     10557704       10850988       +2.78%

benchmark           old bytes      new bytes      delta
BenchmarkHugo-4     1628022920     1632976488     +0.30%

I guess this is mostly about doing "more work". I have done some general tuning in another PR (see #2378) after some profile work.

  • Add Translations and AllTranslations to Node.
  • Rework the site build process. Looping every site/language and doing the same for all of them kind of works, but isn't very effective nor elegant. Needs to extract the common tasks and do it once only.
  • Rework the documentation.
  • Fix all the TODO(bep) multilingo and TODO(bep) ml comments.
  • Check the relevant URL funcs, absURL etc.
  • Add more tests
  • Write redirect page to default lang on / when multilingual
  • Write a global sitemap.xml
  • Check that taxonomies can be configured on a per language basis
  • Add YAML config test
  • Check sitemap per language
  • Check list command etc.
  • Move shortcode handling to "pre render". The site isn't really ready at the current point where the shortcodes gets rendered, which comes as a surprise to many. This is even more true now with the multilanguage feature (Site.Pages etc. will be empty). So we need to move this handling to a later stage.
  • Watch: Handling adding and removing languages
  • Check Blackfriday config per site
  • Livereload inject
  • Check ref, relref
  • implement #2312
  • Improve the default i18n vs missing bundles and translations
  • See https://github.com/spf13/hugo/pull/2303/files#diff-d7b04948857565053b55f353ccb2bab2R296 while this is a temporary workaround until we get a proper registry for "all nodes and pages", this may be confusing to users expecting the home object in the translations object to be a full blown home. Now even the title is kind of wrong when it is set per language. We should fix this if it isn't too hard. A temporary "node map" maybe.
  • check data in Page.Site.Data from shortcodes + add some data to the ML tests
  • fix variables docs section -- there are some old and not valid info there now
  • Double check all "reuse of nodes for RSS etc"
  • Double check the collection transfers
  • Check i18n template func in shortcode
  • Check shortcode changes vs livereload
  • Fix Go 1.7 vet issues
@bep bep added this to the v0.17 milestone Jul 26, 2016
@bep bep self-assigned this Jul 26, 2016
@the1900
the1900 commented Jul 27, 2016 edited

I feel really pleasurable about this feature. If you don't mind I think taxonomy's should be multilingual too.

When see the taxonomy the url is fixed to domain/taxonomy but if url were domain/lang/taxonomy then it is more flexible I guess.

@bep
Collaborator
bep commented Jul 27, 2016 edited

@the1900 I meant it when I said "no comments, please". I have a shitload of work to get the foundation up and running and I don't need "it would be nice if ...".

On a side note, I totally agree about the taxonomies.

@bep bep locked and limited conversation to collaborators Jul 27, 2016
@bep bep unlocked this conversation Jul 27, 2016
@CLAassistant
CLAassistant commented Aug 5, 2016 edited

CLA assistant check
All committers have signed the CLA.

@bep
Collaborator
bep commented Aug 5, 2016

/cc @hacdias you might want to have a look at this re. your caddy plugin. Shout if you don't understand or if you need something special ...

@isysd isysd referenced this pull request in TigoCTM/tigoctm Aug 8, 2016
Open

localization support for Spanish #48

@bep bep changed the title from Work In Progress: Finish the multilingual feature to Finish the multilingual feature Aug 8, 2016
@bep
Collaborator
bep commented Aug 8, 2016 edited

OK, this should work. A little pragmatic in some areas, but it is well tested.

As to how it works, see

https://github.com/spf13/hugo/blob/d8c372cad52c44f76943f8c5592dc02a1eb65409/docs/content/content/multilingual.md

Happy code review!

/cc @spf13

@bep bep added a commit that referenced this pull request Aug 9, 2016
@bep bep Improve i18n string handling
* Fall back to default language on missing translation file
* Add a i18n-warnings build flag
* If that flag is set, print a parseable and greppable string on missing translation strings

See #2303
63c4345
@hacdias
Contributor
hacdias commented Aug 9, 2016

I'll check this out asap. :) Thanks for mentioning.

@gntech
Contributor
gntech commented Aug 9, 2016

There is some problem reading the Language config when using a yaml-config file.

---
baseurl: "http://replace-this-with-your-hugo-site.com/"
languageCode: "en-us"
title: "My New Hugo Site"

Languages:
  en:
    weight: 1
  fr:
    weight: 2
Error: Error building site: Failed to parse multilingual config: Language config is not a map: map[]

When I try the same config in a toml-format it works as it should.

@gntech gntech commented on the diff Aug 9, 2016
docs/content/content/multilingual.md
+date: 2016-01-02T21:21:00Z
+menu:
+ main:
+ parent: content
+next: /content/example
+prev: /content/summaries
+title: Multilingual Mode
+weight: 68
+toc: true
+---
+Hugo supports multiple languages side-by-side (added in `Hugo 0.17`). Define the available languages in a `Languages` section in your top-level `config.yaml` (or equivalent).
+
+Example:
+
+```
+DefaultContentLanguage = "en"
@gntech
gntech Aug 9, 2016 Contributor

This is not yaml-syntax

@bep
bep Aug 9, 2016 Collaborator

You are right, it is TOML ... Will fix the doc.

@gntech
gntech Aug 9, 2016 Contributor

Actually I was referring to only line 17. That line is TOML while line 18-32 is YAML

@gntech gntech and 1 other commented on an outdated diff Aug 9, 2016
docs/content/templates/variables.md
@@ -58,6 +58,8 @@ matter, content or derived from file location.
**.IsPage** Always true for page.<br>
**.Site** See [Site Variables]({{< relref "#site-variables" >}}) below.<br>
**.Hugo** See [Hugo Variables]({{< relref "#hugo-variables" >}}) below.<br>
+**.Translations** A map to other pages with the same filename, but with a different language-extension (like `post.fr.md`). Populated only if `Multilingual` is enabled in your site config.
+**.Lang** Taken from the language extension notation. Populated only if `Multilingual` is enabled for your site config.
@gntech
gntech Aug 9, 2016 Contributor

Populated only if 'Languages' is enabled in your site config?

@nlsw
nlsw Aug 11, 2016 edited

There should be <br> at the end of line 61. I would also add a link to /content/multilingual/#link-to-translated-content after line 61.

@nlsw
nlsw Aug 11, 2016

I've been testing the variables in a template: .Lang works nice. But the map .Translations is empty for me.

@gntech
Contributor
gntech commented Aug 9, 2016

I am unable to use my data-files from shortcodes. This was possible before through .Page.Site.Data. Is this a bug or should I use some other variable now with the multilingual feature?

@bep
Collaborator
bep commented Aug 9, 2016

@gntech I will check data and add a test for it.

@bep
Collaborator
bep commented Aug 10, 2016

@gntech see 85345d9 I cannot reproduce it. I would rather say that this was an issue pre this branch. Now we evaluate the shortcodes as late as possible.

@bep
Collaborator
bep commented Aug 10, 2016 edited

To see what is needed to update a site to multilingual, see this commit from one of my sites:

bep/bep.is@332dbda

It is a one-pager, so maybe not very typical, but you get the drift.

See it in action here:

http://bep.is/

@nlsw
nlsw commented Aug 10, 2016

Config.yaml doesn't work for me: Error: Error building site: Failed to parse multilingual config: Language config is not a map: map[]. I've been using the exact code as in the docs (except the toml issue of @gntech above). Config.toml works great.

@bep
Collaborator
bep commented Aug 10, 2016 edited

@nils-holger ok, I'll add a test for a yaml config, I'll admit I haven't tested that, but thought that should just work.

@moorereason moorereason and 1 other commented on an outdated diff Aug 10, 2016
helpers/url.go
+ if addSlash {
+ in += "/"
+ }
+ }
+ }
+ return MakePermalink(baseURL, in).String()
+}
+
+func getLanguagePrefix() string {
+ defaultLang := viper.GetString("DefaultContentLanguage")
+ defaultInSubDir := viper.GetBool("DefaultContentLanguageInSubdir")
+
+ if !viper.GetBool("Multilingual") {
+ return ""
+ }
+ currentLang := viper.Get("CurrentContentLanguage").(*Language).Lang
@moorereason
moorereason Aug 10, 2016 Collaborator

Check for nil before accessing Lang.

@bep
bep Aug 10, 2016 Collaborator

I need to panic if it isn't there (which suggests a programming error anyhow), so it might as well be a panic with a nil pointer.

@moorereason moorereason commented on an outdated diff Aug 10, 2016
helpers/url.go
+ addSlash := in == "" || strings.HasSuffix(in, "/")
+ in = path.Join(prefix, in)
+
+ if addSlash {
+ in += "/"
+ }
+ }
+ }
+ return MakePermalink(baseURL, in).String()
+}
+
+func getLanguagePrefix() string {
+ defaultLang := viper.GetString("DefaultContentLanguage")
+ defaultInSubDir := viper.GetBool("DefaultContentLanguageInSubdir")
+
+ if !viper.GetBool("Multilingual") {
@moorereason
moorereason Aug 10, 2016 Collaborator

Move this if to the top of the function to exit earlier.

@moorereason moorereason commented on an outdated diff Aug 10, 2016
hugolib/hugo_sites.go
+ }
+ }
+
+ for i := 1; i < len(h.Sites); i++ {
+ h.Sites[i].AllPages = h.Sites[0].AllPages
+ }
+ }
+
+ if len(h.Sites) > 1 {
+ pages := h.Sites[0].AllPages
+ allTranslations := pagesToTranslationsMap(h.multilingual, pages)
+ assignTranslationsToPages(allTranslations, pages)
+ }
+}
+
+// preRender performs build tasks that needs to be done as late as possible.
@moorereason
moorereason Aug 10, 2016 Collaborator

s/needs/need/

@moorereason moorereason commented on the diff Aug 10, 2016
hugolib/node.go
@@ -144,10 +180,147 @@ type URLPath struct {
Section string
}
+func (n *Node) URL() string {
+ return n.addLangPathPrefix(n.URLPath.URL)
+}
+
+func (n *Node) Permalink() string {
+ return permalink(n.URL())
+}
@moorereason
moorereason Aug 10, 2016 Collaborator

I know we do this already on the Page struct (see .Page.Section()), but I don't like these two funcs (URL() & Permalink()). We're embedding URLPath into the Node, which embeds the URL and Permalink fields. Overshadowing those fields with funcs smells bad to me.

We don't need to fix all of Hugo's problems in this PR, but I'd like to see us change the Node struct to have urlPath URLPath and then access n.urlPath.URL. We'd need to add the Slug() and Section() funcs to Node and update code all over the place, but at least we'd avoid this overloading of embedded fields business and some confusion about how those embedded URLPath fields are supposed to be used, esp. with i18n thrown into the mix.

@bep
bep Aug 10, 2016 Collaborator

Yes, I kind of agree ... but ... you will find a lot of stuff that should be done, but I think we should draw some line. I have put a lot of sweat into making better tests, so changes like you suggest should be safer to do. My big motivation for the change above was to get a simple 5 lines template example listing all the translations of a page or a node without all the IsPage and IsHome special cases. I feel that trumps a little code impurity for a while.

@bep
Collaborator
bep commented Aug 10, 2016

@nils-holger see 663f09d re YAML not working. Thanks for the report. I was of course too lazy to test JSON ...

@nlsw nlsw and 1 other commented on an outdated diff Aug 11, 2016
docs/content/templates/functions.md
+
+### i18n
+
+This translates a piece of content based on your `i18n/en-US.yaml`
+(and friends) files. You can use the
+[go-i18n](https://github.com/nicksnyder/go-i18n) tools to manage your
+translations. The translations can exist in both the theme and at the
+root of your repository.
+
+e.g.: `{{ i18n "translation_id" }}`
+
+
+### T
+
+`T` is an alias to `i18n`. E.g. `{{ T "translation_id" }}`.
+>>>>>>> Add multilingual support in Hugo
@nlsw
nlsw Aug 11, 2016 edited

Line 765 can just be deleted. This todo is done (Yay!). Maybe we could add a link to /content/multilingual/#translation-of-strings to clarify.

@bep
bep Aug 11, 2016 Collaborator

That is a sloppy Git merge from me ... thanks.

@bep
bep Aug 11, 2016 Collaborator

And a link is a good idea.

@mitchchn
Contributor
mitchchn commented Aug 11, 2016 edited

Apologies if this isn't the right time/place to report this, but I found a bug when testing this PR: layouts do not have access to $.Site.Data when rendering translated pages (it's set to a nil map).

@bep
Collaborator
bep commented Aug 11, 2016

@ mitchchn I will check, thanks.

@bep
Collaborator
bep commented Aug 11, 2016

@mitchchn OK, I see whats happening. Stupid mistake. Will fix.

@bep
Collaborator
bep commented Aug 11, 2016

@mitchchn I fixed the Data issue. Please take it for a spin :-)

@gntech
Contributor
gntech commented Aug 11, 2016

@bep commit 3b4607f fixed the problem I had with reaching my data from shortcodes!

@mitchchn
Contributor

@bep That fixed the Data, thanks. There still seem to be things missing from .Site in translated content. $.Site.Taxonomies only includes translated pages for instance.

@bep
Collaborator
bep commented Aug 11, 2016

That is by design. Taxonomies are site local, but they can have translations. I will double check others.

@gntech
Contributor
gntech commented Aug 11, 2016

I have found a peculiar bug with the Permalink to translated content when I am on a node page. I have Swedish and English on my site with Swedish being the default language. When I am on the Swedish node page the link to the corresponding english node page works as expected however when I am on the English nodepage the Permalink back to Swedish nodepage points to the RSS "index.xml" of that node. A bit hard to explain but Very peculiar.

To summarize: The permalink to the translated counterpart of a node goes to the RSS page of the translated node.

@bep
Collaborator
bep commented Aug 11, 2016

@gntech I understand that issue, but I thought I had fixed every places. Earlier the node instances from, say the home page and the home page's rss feed, where reused. Now when we use the node pointers to create a "translation map", this didn't work. It's an easy fix and thanks for testing.

@bep
Collaborator
bep commented Aug 11, 2016

@gntech i have commited a fix to your issue.

@nlsw nlsw commented on an outdated diff Aug 12, 2016
docs/content/templates/variables.md
@@ -118,10 +121,13 @@ includes taxonomies, lists and the homepage.
**.IsPage** Always false for nodes.<br>
**.Site** See [Site Variables]({{< relref "#site-variables" >}}) below.<br>
**.Hugo** See [Hugo Variables]({{< relref "#hugo-variables" >}}) below.<br>
+**.Translations** A list of translated versions of the current node. All nodes (except the pager nodes) can have translated counter parts. See [Multilingual]({{< relref "content/multilingual.md" >}}) for more info. <br>
+**.HasTranslations** Whether there are any translations to display.<br>
@nlsw
nlsw Aug 12, 2016

I've tried these variables in a single template:
Line 124: .Translations gives an empty list [] instead of the expected result
Line 125: .HasTranslations gives an error: HasTranslations is not a field of struct type *hugolib.Page

@moorereason moorereason and 1 other commented on an outdated diff Aug 12, 2016
hugolib/site.go
BuildDrafts: viper.GetBool("BuildDrafts"),
canonifyURLs: viper.GetBool("CanonifyURLs"),
- preserveTaxonomyNames: viper.GetBool("PreserveTaxonomyNames"),
+ preserveTaxonomyNames: lang.GetBool("PreserveTaxonomyNames"),
@moorereason
moorereason Aug 12, 2016 Collaborator

Does this mean that RSSUri and PreserveTaxonomyNames can modified on a per-language basis? If so, we should note that in the documentation.

@bep
bep Aug 12, 2016 Collaborator

It is noted in the documentation in a vague way ... and I think it should stay this vague until it is carved in stone.

@mitchchn
Contributor

One more: the i18n function does not appear to work in shortcodes.

ERROR: 2016/08/12 15:54:19 shortcode.go:590: error processing shortcode shortcodes/callout.html 
 ERR: template: shortcodes/callout.html:9:5: executing "shortcodes/callout.html" at <i18n "help">: error calling i18n: i18n not initialized, have you configured everything properly?

The same function call works fine in layouts.

@bep bep added a commit that referenced this pull request Aug 13, 2016
@bep bep Improve i18n string handling
* Fall back to default language on missing translation file
* Add a i18n-warnings build flag
* If that flag is set, print a parseable and greppable string on missing translation strings

See #2303
8c5ff2f
@bep
Collaborator
bep commented Aug 13, 2016

@mitchchn @gntech and others: My last commit fixes some issues when running in server watch mode, with reloading of changed shortcodes and similar. It would be helpful if you could take it for a spin.

I consider this branch solid enough now. @spf13 may have some to say, so I'll assign this issue to him.

@bep bep assigned spf13 and unassigned bep Aug 13, 2016
@mitchchn
Contributor

@bep It works very well now. Nothing else has come up in my testing. 👍

@gntech
Contributor
gntech commented Aug 14, 2016

@bep I have tested the latest code now and I have found no issues. Kjempebra! :)

@nlsw
nlsw commented Aug 15, 2016

@bep I've tested all documented features and all is working great now. Thanks for all time and efforts.

@bep bep added a commit that referenced this pull request Aug 15, 2016
@bep bep Improve i18n string handling
* Fall back to default language on missing translation file
* Add a i18n-warnings build flag
* If that flag is set, print a parseable and greppable string on missing translation strings

See #2303
bbc549e
@bep
Collaborator
bep commented Aug 16, 2016

For some performance numbers, see https://github.com/bep/hugo-benchmark

@bep bep added a commit that referenced this pull request Aug 20, 2016
@bep bep Improve i18n string handling
* Fall back to default language on missing translation file
* Add a i18n-warnings build flag
* If that flag is set, print a parseable and greppable string on missing translation strings

See #2303
d76e87b
abourget and others added some commits May 14, 2016
@abourget @bep abourget Add multilingual support in Hugo
Implements:
* support to render:
  * content/post/whatever.en.md to /en/2015/12/22/whatever/index.html
  * content/post/whatever.fr.md to /fr/2015/12/22/whatever/index.html
* gets enabled when `Multilingual:` is specified in config.
* support having language switchers in templates, that know
  where the translated page is (with .Page.Translations)
  (when you're on /en/about/, you can have a "Francais" link pointing to
   /fr/a-propos/)
  * all translations are in the `.Page.Translations` map, including the current one.
* easily tweak themes to support Multilingual mode
* renders in a single swift, no need for two config files.

Adds a couple of variables useful for multilingual sites

Adds documentation (content/multilingual.md)

Added language prefixing for all URL generation/permalinking see in the
code base.

Implements i18n. Leverages the great github.com/nicksnyder/go-i18n lib.. thanks Nick.
* Adds "i18n" and "T" template functions..
132035a
@bep bep Add proper Language and Languages types ab69f6d
@bep bep Add Translations and AllTranslations methods to Page
Will revisit Node later.
ace89dc
@bep bep Rename MainSites to Sites
Having many *main* sites doesn't make much sense.
45368b1
@bep bep Reset translation slice on rebuild
Also add all translations, including the current, to the slice. We filter later.
ee608e3
@bep bep Introduce HugoSites type
And a Hugo global variable which contains the site under build.

This is really needed to get some level of control of the "multiple languages" in play.

There are still work related to this scattered around, but that will come.

With this commit, the multilingual feature is starting to work.
57137dd
@bep bep Rework the i18n template func handling
Setting the language to use when loading the language bundles just doesn't work.
The template system is unfortanetely a global, and the last languate processed won ...
0cd90de
@bep bep Add Translations and AllTranslations to Node
This commit also consolidates URLs on Node vs Page, so now .Permalink should be interoperable.

Note that this implementations should be fairly short-livded, waiting for #2297, but the API should be stable.
a414c0b
@bep bep Move HugoSites to hugolib
It will get more involved in the build process in a minute.

See #2309
b9e234e
@bep bep Move the Build* methods to HugoSites
See #2309
5101f14
@bep bep Optimize the multilanguage build process
Work In Progress!

This commit makes a rework of the build and rebuild process to better suit a multi-site setup.

This also includes a complete overhaul of the site tests. Previous these were a messy mix that
were testing just small parts of the build chain, some of it testing code-paths not even used in
"real life". Now all tests that depends on a built site follows the same and real production code path.

See #2309
Closes #2211
Closes #477
Closes #1744
e7efd95
@bep bep Render the shortcodes as late as possible
This is needed to make shortcode users happy with the new multilanguage support,
but it will also solve many other related posts about "stuff not available in the shortcode".

We will have to revisit this re the handler chain at some point, but that will be easier
now as the integration test story has improved so much.

As part of this commit, the site-building tests in page_test.go is refreshed, they now
tests for all the rendering engines (when available), and all of them now uses the
same code-path as used in production.

Fixes #1229
Fixes #2323
Fixes ##1076
fa30293
@bep bep Rework the multilingual docs
And in the same go adjusted some minor parts of the language API:

Add LanguagePrefix alias to Node and rename the Multilingual config section to Languages.

See #2309
a875e2d
@bep bep Redirect to main language from root
See #2312
See #2309
31b31ac
@bep bep Add sitemap index for multilingual sites
See #2309
0cee248
@bep bep Make the config loading testable
This is needed to verify  #2309, but it closes a big hole in Hugo's automated tests.

The loading of the config is now moved to `hugolib` and the same default settings are now used
in production and tests.

As Viper now uses Afero as its filesystem, we now can write fairly complete integration tests with ease.

See #2309
df2a13f
@bep bep Make taxonomies configurable per language
See #2312
0cb0ed9
@bep bep Get the list commands up to multi-site level
This commit also unexports some Site methods, making it clear what the external build API really is.

See #2312
01cf48f
@bep bep cmd: Load config from the common config loader in hugolib
See #2309
34b19ba
@bep bep Make it possible to add a language in server mode
See #2309
29ccd24
@bep bep Make it possible to configure Blackfroday per language
See #2309
d8e0497
@bep bep Improve language handling in URLs
The current "rendering language" is needed outside of Site. This commit moves the Language type to the helpers package, and then used to get correct correct language configuration in the markdownify template func.
This commit also adds two new template funcs: relLangURL and absLangURL.

See #2309
b00623f
@bep bep Fix the shortcode ref tests
See #2309
eee1132
@bep bep Fix livereload in multilingual mode
See #2309
cfebc29
@bep bep Fix some corner cases in revised summary handling
And clean up the test.

See #2309
5182241
@bep bep Multilingual TODO-fixes, take 1
See #2309
3037b2d
@bep bep Make sure drafts etc. are not processed
See #2309
d9bcbe6
@bep bep Make the check command work in multilingual mode
Or: some more multilingual TODO-fixes.

See #2309
e7f0e3a
@bep bep Add parent as owner to Site
And pull up common member vars like Tmpl and Multilinguage.

Or: the final multilingual TODO-fixes.

See #2309
f42fc56
@bep bep Render main content language in root by default
Fixes #2312
5fa9d17
@bep bep Improve i18n string handling
* Fall back to default language on missing translation file
* Add a i18n-warnings build flag
* If that flag is set, print a parseable and greppable string on missing translation strings

See #2303
ae6a4fa
@bep bep Remove unused Multilingual Viper default
See #2312
b7a922c
@bep bep Add IsTranslated to Node and Page
Makes the templates simpler.

See #2309
1767750
@bep bep Handle error in config loading
See #2309
b3ecfcd
@bep bep doc: Fix TOML vs YAML in multilang section
Updates ##2309
d8291b7
@bep bep Create a Node map to get proper node translations
In a multi-language setup, before this commit the Node's Translations() method
would return some "dummy nodes" that would point to the correct page (Permalink),
but would not be the same as the node it points to -- it would not have the translated
title etc.

The node creation is, however, so mingled with rendering, whihc is too early to have any global state,
so the nodes has to be split in a prepare and a render phase. This commits does that with as small
a change as possible. This implementation is a temp solution until we fix #2297.

Updates #2309
1dc571b
@bep bep Add temp MULTILINGUAL version suffix to this branch
For people having trouble building this.

Now `hugo version` should print something like:

```
Hugo Static Site Generator v0.17-MULTILINGUAL BuildDate: 2016-08-10T08:20:36+02:00
```
3dd112e
@bep bep Add data tests
Updates #2309
b54f2ff
@bep bep Fix YAML loading of multilingual config
And some other minor fixes from code review.

Updates #2309
a1b2d47
@bep bep Add JSON config to the multilanguage testing
Updates #2309
e0a2715
@bep bep docs: Get the variable and funcs re multilingual up-to-date 949d8b4
@bep bep Fix Data in multisites
Updates #2309
b7c1d5c
@bep bep Create a copy of the section node for RSS
So the Permalink gets correct when listing translations.

I have also checked the other relevant places to make sure we do not overwrite node values we need later.

Pointers can be tricky, but lesson learned is: A copy is cheap.

Updates #2309
3834927
@bep bep docs: Fix spelling: HasTranslations > IsTranslated 5af4bc1
@bep bep Small adjustment to SiteInfo init
After a visual inspection to make (pretty) sure it is correct re multiple languages.

Updates #2309
5b41d8f
@bep bep Set lang template globals for each site when render shortcodes
We should get rid of these globals, but that is another month.
d93a863
@bep bep Fix multilingual reload when shortcode changes
This commit also refines the partial rebuild logic, to make sure we do not do more work than needed.

Updates #2309
7f2871b
@bep bep Fix site reset for benchmarks etc.
Updates #2309
a5ed858
@bep bep Make sure the 404 node has .Data.Pages
Updates #2309
9dd7ac2
@bep bep Add a global Reset func
So we can do some benchmarking.
5c98048
@bep bep Fix go vet 1.7 issues
Updates #2309
680636c
@gour
Contributor
gour commented Aug 28, 2016

I've built 0.17multilingual and after reading the docs tried to run:

hugo --i18n-warnings | grep i18n i18n|MISSING_TRANSLATION|en|wordCount

but it reports about:

Error: unknown flag: --i18n-warnings

What do I miss?

@abourget
Contributor

What's lugo?!

@abourget
Contributor

Would it be useful that I review some more ? Are we good to go with this or does someone else need to take a look ?

I'll be happy to migrate my sites with any changes that were introduced here.. (since m17n) !

@gntech
Contributor
gntech commented Aug 30, 2016

I think we are awaiting @spf to take a look at this and give the official go ahead

@bep
Collaborator
bep commented Aug 31, 2016

@yitzhakbg please use the forum for questions and marketing.

@yitzhakbg

Pardon me. Thanks for the correction

Yitzhak Bar Geva https://www.linkedin.com/in/yitzhakbg

On 1 September 2016 at 00:56:27, Bjørn Erik Pedersen (
notifications@github.com) wrote:

@yitzhakbg https://github.com/yitzhakbg please use the forum for
questions and marketing.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2303 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAA49IXiI55Cjn7ShuTZIoR3z7gOoUHMks5qlfh2gaJpZM4JVIOD
.

@bep
Collaborator
bep commented Sep 3, 2016

@spf13 has promised to take some time off his schedule to look at this PR. If he does not object to its content in the next few days, I will merge it.

@gcushen gcushen referenced this pull request in gcushen/hugo-academic Sep 4, 2016
Closed

Localization and multilingual support #12

@bep bep assigned bep and unassigned spf13 Sep 5, 2016
@bep bep added a commit that referenced this pull request Sep 6, 2016
@bep bep Improve i18n string handling
* Fall back to default language on missing translation file
* Add a i18n-warnings build flag
* If that flag is set, print a parseable and greppable string on missing translation strings

See #2303
f1e1cda
@bep
Collaborator
bep commented Sep 6, 2016

Merged!

@bep bep closed this Sep 6, 2016
@kulla kulla referenced this pull request in gcushen/hugo-academic Sep 14, 2016
Closed

For which hugo version shall this theme be compatible with? #31

@bep bep deleted the multilingual branch Dec 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment