mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
93572e5318
commit
58adbeef88
2 changed files with 12 additions and 4 deletions
|
@ -701,12 +701,15 @@ Data: {{ .Site.Data }}
|
||||||
|
|
||||||
createSymlinks := func(baseDir, id string) {
|
createSymlinks := func(baseDir, id string) {
|
||||||
for _, dir := range files.ComponentFolders {
|
for _, dir := range files.ComponentFolders {
|
||||||
|
// Issue #9119: private use language tags cannot exceed 8 characters.
|
||||||
|
if dir != "i18n" {
|
||||||
c.Assert(os.Chdir(filepath.Join(baseDir, dir)), qt.IsNil)
|
c.Assert(os.Chdir(filepath.Join(baseDir, dir)), qt.IsNil)
|
||||||
c.Assert(os.Symlink("real", fmt.Sprintf("realsym%s", id)), qt.IsNil)
|
c.Assert(os.Symlink("real", fmt.Sprintf("realsym%s", id)), qt.IsNil)
|
||||||
c.Assert(os.Chdir(filepath.Join(baseDir, dir, "real")), qt.IsNil)
|
c.Assert(os.Chdir(filepath.Join(baseDir, dir, "real")), qt.IsNil)
|
||||||
c.Assert(os.Symlink("data.toml", fmt.Sprintf(filepath.FromSlash("datasym%s.toml"), id)), qt.IsNil)
|
c.Assert(os.Symlink("data.toml", fmt.Sprintf(filepath.FromSlash("datasym%s.toml"), id)), qt.IsNil)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
createSymlinks(workDir, "project")
|
createSymlinks(workDir, "project")
|
||||||
createSymlinks(themeDir, "mod")
|
createSymlinks(themeDir, "mod")
|
||||||
|
|
|
@ -93,6 +93,11 @@ func addTranslationFile(bundle *i18n.Bundle, r source.File) error {
|
||||||
lang := paths.Filename(name)
|
lang := paths.Filename(name)
|
||||||
tag := language.Make(lang)
|
tag := language.Make(lang)
|
||||||
if tag == language.Und {
|
if tag == language.Und {
|
||||||
|
try := artificialLangTagPrefix + lang
|
||||||
|
_, err = language.Parse(try)
|
||||||
|
if err != nil {
|
||||||
|
return _errors.Errorf("%q %s.", try, err)
|
||||||
|
}
|
||||||
name = artificialLangTagPrefix + name
|
name = artificialLangTagPrefix + name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue