Skip to content

Commit

Permalink
issue #33 lexicon complete update bug
Browse files Browse the repository at this point in the history
  • Loading branch information
christos.dionysopoulos committed Nov 22, 2022
1 parent 9d0a632 commit 78db511
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ private void updateTranslations(Map<String, Object> contents) {
Set<GroupDTO> newGroups = groupService
.getRemainingGroups(excludedGroupName);
for (GroupDTO group : newGroups) {
updateKeys(translations, group.getId(), languageId);
updateKeys(translations, group.getId(), languageId, locale);
}
} else { // Process group
String groupName = (String) translationContent.get("group");
String groupId =
groupName != null ? groupService.getGroupByTitle(groupName).getId()
: null;
updateKeys(translations, groupId, languageId);
updateKeys(translations, groupId, languageId, locale);
}
}
}
Expand All @@ -244,8 +244,7 @@ private void updateTranslations(Map<String, Object> contents) {
* @param languageId the id of the translation language
*/
private void updateKeys(List<Map<String, Object>> translations,
String groupId,
String languageId) {
String groupId, String languageId, String locale) {
log.finest(MessageFormat
.format(
"Updating translations of group with id {0} for language with id {1}",
Expand Down Expand Up @@ -291,8 +290,8 @@ private void updateKeys(List<Map<String, Object>> translations,
// adding a new language) and therefore it should be
// updated. Otherwise only update the key if the forceUpdate
// flag is set to true.
else if ((keyDTO.getTranslations().get(languageId) == null)
|| (keyDTO.getTranslations().get(languageId).equals(translationKey))
else if ((keyDTO.getTranslations().get(locale) == null)
|| (keyDTO.getTranslations().get(locale).equals(translationKey))
|| ((translation.get(FORCE_UPDATE) != null)
&& (Boolean.TRUE.equals(translation.get(FORCE_UPDATE))))) {
keyService
Expand Down

0 comments on commit 78db511

Please sign in to comment.