Skip to content

Commit

Permalink
fix: replace text by key in quick fix
Browse files Browse the repository at this point in the history
The quick fix was using the value of a key-value pair in the i18n properties file instead of the key
  • Loading branch information
fausto-m committed Sep 29, 2022
1 parent 930cd5f commit 70539f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function computeQuickFixI18nSuggestion(
const newTextSuggestion = {
suggestionKey: i18nReplacementSuggestionKey,
suggestionValue: i18nReplacementSuggestionValue,
newText: `${attributeKey}="{i18n>${i18nReplacementSuggestionValue}}"`,
newText: `${attributeKey}="{i18n>${i18nReplacementSuggestionKey}}"`,
};
return newTextSuggestion;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { getUI5PropertyByXMLAttributeKey } from "@ui5-language-assistant/logic-u
import { UseOfHardcodedI18nStringIssue } from "../../../api";
import { isPossibleBindingAttributeValue } from "../../utils/is-binding-attribute-value";
import { getUserFacingAttributes } from "../../utils/ui5-user-facing-attributes";
import { find } from "lodash";

export function validateI18nExternalization(
attribute: XMLAttribute,
Expand Down Expand Up @@ -37,10 +38,9 @@ export function validateI18nExternalization(
const oUITextProperties = getUserFacingAttributes();

if (propParentClassFullName && oUITextProperties[propParentClassFullName]) {
const sUITextualProperty = oUITextProperties[propParentClassFullName].find(
(sUITextualProperty) => {
return sUITextualProperty === ui5Property?.name;
}
const sUITextualProperty = find(
oUITextProperties[propParentClassFullName],
(sUITextualProperty) => sUITextualProperty === ui5Property?.name
);

if (sUITextualProperty) {
Expand Down

0 comments on commit 70539f8

Please sign in to comment.