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
Docs multi language #1180
Conversation
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}"; |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
Resolves #482