Skip to content

Commit 90e525f

Browse files
EvangelinkCopilot
andauthored
Use union merge driver for .resx and .xlf files (#8468)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 643c819 commit 90e525f

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

.gitattributes

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,27 @@
6767
#*.rtf diff=astextplain
6868
#*.RTF diff=astextplain
6969

70-
.github/workflows/*.lock.yml linguist-generated=true merge=ours
70+
.github/workflows/*.lock.yml linguist-generated=true merge=ours
71+
72+
###############################################################################
73+
# Localization resource files
74+
#
75+
# Edits to .resx and .xlf files are nearly always additive (new entries with
76+
# distinct keys), so the union merge driver concatenates both sides instead of
77+
# producing conflict markers. This significantly reduces friction when several
78+
# PRs add new strings in parallel.
79+
#
80+
# Caveats:
81+
# * If two PRs add an entry with the SAME name/id, both will end up in the
82+
# file and the build will fail with a duplicate-resource error. Resolve by
83+
# editing the .resx and re-running the project's `/t:UpdateXlf` target.
84+
# * If two PRs modify the SAME existing line (e.g. retouch the same English
85+
# string or translation), union merges both sides silently with no
86+
# conflict marker. Review resx/xlf hunks during PR review when both sides
87+
# touched pre-existing entries.
88+
# * XLF files are generated from the neutral .resx via the `UpdateXlf`
89+
# MSBuild target, so any union artefact in an xlf can be recovered by
90+
# running that target.
91+
###############################################################################
92+
*.resx merge=union
93+
*.xlf merge=union

0 commit comments

Comments
 (0)