void (@NotNull Project project, Collection<XmlTag> tags, PropertiesFile propertiesFile, boolean isAction) { for (XmlTag tag : tags) { String text = tag.getAttributeValue("text"); tag.setAttribute("text", null); String description = tag.getAttributeValue("description"); tag.setAttribute("description", null); String id; if (tag.getName().equals("override-text")) { id = Objects.requireNonNull(tag.getParentTag()).getAttributeValue("id") + "." + tag.getAttributeValue("place"); } else { id = tag.getAttributeValue("id"); } List<PropertiesFile> propertiesFiles = Collections.singletonList(propertiesFile); @NonNls String actionOrGroupPrefix = isAction ? "action." : "group."; if (text != null) { JavaI18nUtil.DEFAULT_PROPERTY_CREATION_HANDLER.createProperty(project, propertiesFiles, actionOrGroupPrefix + id + ".text", text, new UExpression[0]); } if (description != null) { JavaI18nUtil.DEFAULT_PROPERTY_CREATION_HANDLER.createProperty(project, propertiesFiles, actionOrGroupPrefix + id + ".description", description, new UExpression[0]); } tag.processElements(element -> { if (element instanceof PsiWhiteSpace && element.textContains('\n')) { PsiElement next = element.getNextSibling(); if (next instanceof LeafPsiElement) { IElementType type = ((LeafPsiElement)next).getElementType(); if (type == XmlTokenType.XML_TAG_END || type == XmlTokenType.XML_EMPTY_ELEMENT_END) { element.delete(); return false; } } } return true; }, tag.getFirstChild()); } }