Skip to content

Does _generic.translation still need hardcoded "Apply", "Cancel" ... responses? #86

@rouilj

Description

@rouilj

The current (_generic.translation)[https://github.com/UMB-CS-682-Team-03/tracker/blob/3c827ab4e9309c0e2582abd5c48c6a03fcad8524/html/_generic.translation#L5-L10] includes hard coded endpoints for "Apply", "Cancel" ...

However I think these lines:

tracker/html/classhelper.js

Lines 310 to 320 in 3c827ab

CLASSHELPER_TRANSLATION_KEYWORDS.forEach(key => keys.add(key));
ClassHelper.translations = {};
for (let key of keys) {
ClassHelper.translations[key] = key;
}
let tracker = window.location.pathname.split('/')[1];
let url = new URL(window.location.origin + "/" + tracker + '/');
url.searchParams.append("@template", "translation");
url.searchParams.append("properties", Array.from(keys.values()).join(','));

add the:

const CLASSHELPER_TRANSLATION_KEYWORDS = ["apply", "cancel", "next", "prev", "search", "reset", CLASSHELPER_READONLY_POPUP_TITLE ];

apply, cancel and other terms hardcoded in _generic.translation to the properties list to be translated.

@patel-malav am I correct the hard coded translations:

      "Apply": "<tal:x tal:replace="python:i18n.gettext('Apply')" />",
      "Cancel": "<tal:x tal:replace="python:i18n.gettext('Cancel')" />",
      "Next": "<tal:x tal:replace="python:i18n.gettext('Next')" />",
      "Prev": "<tal:x tal:replace="python:i18n.gettext('Prev')" />",
      "Search": "<tal:x tal:replace="python:i18n.gettext('Search')" />",
      "Reset": "<tal:x tal:replace="python:i18n.gettext('Reset')" />"

can be removed since the terms are now included in the properties query
parameter?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions