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

Docs multi language #1180

Merged
merged 9 commits into from May 30, 2019
Merged

Docs multi language #1180

merged 9 commits into from May 30, 2019

Conversation

yekalkan
Copy link
Member

Resolves #482

@yekalkan yekalkan requested a review from hikalkan May 30, 2019 06:24
@hikalkan hikalkan added this to the 0.18 milestone May 30, 2019
@hikalkan hikalkan merged commit 60233fe into master May 30, 2019
input.Version
);
}

public async Task<DocumentResourceDto> GetResourceAsync(GetDocumentResourceInput input)
{
var project = await _projectRepository.GetAsync(input.ProjectId);
var cacheKey = $"Resource@{project.ShortName}#{input.Name}#{input.Version}";
var cacheKey = $"Resource@{project.ShortName}#{input.LanguageCode}#{input.Name}#{input.Version}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if input.LanguageCode is null?

@@ -92,20 +99,23 @@ async Task<DocumentResourceDto> GetResourceAsync()
);
}

protected virtual async Task<DocumentWithDetailsDto> GetDocumentWithDetailsDto(
protected virtual async Task<DocumentWithDetailsDto> GetDocument(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename ro GetDocumentWithDetailsDtoAsync

{
var language = languageCodes.Languages.FirstOrDefault(l => l.Code == languageCode);

return language ?? languageCodes.Languages.Single(l => l.IsDefault);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throw a better exception if default language is not defined.

@hikalkan hikalkan deleted the Docs-multi-language branch June 12, 2019 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multi-language support for the docs module
2 participants