Skip to content

Commit 0c8a34f

Browse files
committed
Initial commit
0 parents  commit 0c8a34f

File tree

10 files changed

+97
-0
lines changed

10 files changed

+97
-0
lines changed

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/ICE.iml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/easycode.ignore

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/easycode/codebase-v2.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

XML language replacement.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import re
2+
3+
# Input and output file paths
4+
input_file = 'C:\Script\de.dict.xliff.xml'
5+
output_file = 'C:\Script\corrected.xml'
6+
7+
# Read the input file
8+
with open(input_file, 'r', encoding='utf-8') as file:
9+
content = file.read()
10+
11+
# Replace xml:lang="de" with xml:lang="it"
12+
updated_content = re.sub(r'(<target xml:lang=")de(">)', r'\1it\2', content)
13+
14+
# Write the updated content to the output file
15+
with open(output_file, 'w', encoding='utf-8') as file:
16+
file.write(updated_content)
17+
18+
print("The file has been updated and saved as:", output_file)

XML_creation_and_print.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import xml.etree.ElementTree as ET
2+
3+
# Example XML creation using the repaired code
4+
root = ET.Element("root")
5+
srx_rules = ET.SubElement(root, "rules")
6+
7+
# Define your break value
8+
break_value = "yes" # This can be set dynamically
9+
10+
# Correct way to include 'break' attribute in XML
11+
srx_rule = ET.SubElement(srx_rules, "rule", **{"break": break_value})
12+
13+
# Print the resulting XML for verification
14+
print(ET.tostring(root, encoding='unicode'))

0 commit comments

Comments
 (0)