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

@toLang for the main language returning undefined #1

Open
danguilherme opened this issue Apr 22, 2017 · 0 comments
Open

@toLang for the main language returning undefined #1

danguilherme opened this issue Apr 22, 2017 · 0 comments

Comments

@danguilherme
Copy link
Owner

danguilherme commented Apr 22, 2017

@toLang template function returns undefined when requesting the URL with config omitMainFolder set to true.

Seems like the auto-mapping of document translations is not working for the main language without a folder:

for d in allDocs
for l in config.languages
if d.lang!=l and d.lang? and l?
documentUrl = @docUrl d
translationUrl = '/' + l + '/' + (@noLanguagePath d.lang, documentUrl)
if translationUrl of translationsMap
if translationsMap[documentUrl][l]?
if translationsMap[documentUrl][l] != translationUrl
@error "#{documentUrl} already has a translation
#{translationsMap[documentUrl][l]} when adding #{translationUrl}"
else
translationsMap[documentUrl][l] = translationUrl

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

1 participant