Skip to content

Commit

Permalink
Merge branch 'utf8'
Browse files Browse the repository at this point in the history
  • Loading branch information
ALIENQuake committed Jan 30, 2024
2 parents 7d0cb2e + 1e1bf1a commit 22785b0
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 46 deletions.
21 changes: 3 additions & 18 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
# It makes git diff pretty
ascension/lang/czech/**.tra working-tree-encoding=cp1250
ascension/lang/french/**.tra working-tree-encoding=cp1252
ascension/lang/german/**.tra working-tree-encoding=cp1252
ascension/lang/hungarian/**.tra working-tree-encoding=cp1250
ascension/lang/italian/**.tra working-tree-encoding=cp1252
ascension/lang/korean/**.tra working-tree-encoding=cp949
ascension/lang/polish/**.tra working-tree-encoding=cp1250
ascension/lang/portuguese/**.tra working-tree-encoding=cp1252
ascension/lang/russian/**.tra working-tree-encoding=cp1251
ascension/lang/spanish/**.tra working-tree-encoding=cp1252
ascension/lang/swedish/**.tra working-tree-encoding=cp1252
ascension/lang/schinese/**.tra working-tree-encoding=cp936
ascension/lang/tchinese/**.tra working-tree-encoding=cp950
ascension/lang/ukrainian/**.tra working-tree-encoding=cp1251

# Fix Git mess for hive.bgforge.net
*.po text eol=lf
*.pot text eol=lf

# Use export-ignore to skip files when downloading
**/.* export-ignore
.* export-ignore
*.gitignore text eol=crlf
*.gitattributes text eol=crlf

Expand All @@ -41,7 +25,8 @@ ascension/lang/ukrainian/**.tra working-tree-encoding=cp1251
*.ps1 text eol=crlf
*.sh text eol=lf
*.txt text eol=crlf
*.y[a]ml text eol=crlf
*.y[a]ml text eol=lf
*.zip binary

# WeiDU/IE
*.2da text
Expand Down
5 changes: 5 additions & 0 deletions ascension/Ascension.tp2
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ LANGUAGE ~Portuguese (Ecthelion)~
~portuguese~
~ascension/lang/portuguese/setup.tra~

LANGUAGE ~Swedish~
~swedish~
~ascension/lang/swedish/setup.tra~


// test component

// BEGIN test DESIGNATED 99
Expand Down
2 changes: 1 addition & 1 deletion ascension/lang/po/polish.po
Original file line number Diff line number Diff line change
Expand Up @@ -4689,7 +4689,7 @@ msgstr "Ascension"
msgid ""
"You must have ToB installed or use Enhanced Edition to install the Ascension"
" mod."
msgstr "Ta modyfikacja wymaga uprzedniego zainstalowania BG2: ToB lub BG2:EE."
msgstr "Ta modyfikacja wymaga uprzedniego zainstalowania BG2:ToB lub BG2:EE."

#: setup.tra:101002
msgid "Cannot install without Ascension main component."
Expand Down
2 changes: 1 addition & 1 deletion ascension/lang/polish/setup.tra
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@101000 = ~Ascension~
@101001 = ~Ta modyfikacja wymaga uprzedniego zainstalowania BG2: ToB lub BG2:EE.~
@101001 = ~Ta modyfikacja wymaga uprzedniego zainstalowania BG2:ToB lub BG2:EE.~
@101002 = ~Nie można zainstalować bez uprzedniej instalacji komponentu głównego.~
@101003 = ~Musisz zainstalować BG2Fixpack lub korzystać z wersji Enhanced Edition, aby zainstalować tę wersję moda Ascension.~
@101004 = ~Ascension musi być zainstalowane PRZED Spell revisions. Odinstaluj Spell revisions, zainstaluj Ascension, a potem zainstaluj ponownie Spell Revisions.~
Expand Down
51 changes: 25 additions & 26 deletions ascension/lib/sfo_lite.tph
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,26 @@ DEFINE_ACTION_FUNCTION handle_charsets_immutably
base_language=english
iconv_path=""
RET scs_tra_loc
BEGIN
// do conversions (ee only)
ACTION_IF enhanced_edition BEGIN
OUTER_INNER_PATCH_SAVE versionstring "%MOD_VERSION%" BEGIN
REPLACE_TEXTUALLY " " ""
END
OUTER_SPRINT scs_tra_loc "%ext_lang_loc%"
OUTER_SPRINT marker_name "%marker_loc%/dw#%scsroot%_%versionstring%_languages_installed.mrk"
ACTION_IF (!FILE_EXISTS "%marker_name%" || force_tra_rebuild) BEGIN
COPY ".../stratagems-inline/blank" "%marker_name%"
MKDIR "%scs_tra_loc%/%LANGUAGE%"
ACTION_BASH_FOR "%scsroot%/%tra_base%/%LANGUAGE%" ".*\.tra" BEGIN
COPY "%BASH_FOR_FILESPEC%" "%scs_tra_loc%/%LANGUAGE%"
END
ACTION_MATCH "%LANGUAGE%" WITH
"%base_language%" BEGIN END
DEFAULT
BEGIN
ACTION_IF enhanced_edition BEGIN
// on EE, just set the tra loc
OUTER_SPRINT scs_tra_loc "%scsroot%/%tra_base%"
END ELSE BEGIN
// do conversions (classic only)
OUTER_INNER_PATCH_SAVE versionstring "%MOD_VERSION%" BEGIN
REPLACE_TEXTUALLY " " ""
END
OUTER_SPRINT scs_tra_loc "%ext_lang_loc%"
OUTER_SPRINT marker_name "%marker_loc%/dw#%scsroot%_%versionstring%_languages_installed.mrk"
ACTION_IF (!FILE_EXISTS "%marker_name%" || force_tra_rebuild) BEGIN
COPY ".../stratagems-inline/blank" "%marker_name%"
MKDIR "%scs_tra_loc%/%LANGUAGE%"
ACTION_BASH_FOR "%scsroot%/%tra_base%/%LANGUAGE%" ".*\.tra" BEGIN
COPY "%BASH_FOR_FILESPEC%" "%scs_tra_loc%/%LANGUAGE%"
END
ACTION_MATCH "%LANGUAGE%" WITH
"%base_language%" BEGIN END
DEFAULT
MKDIR "%scs_tra_loc%/%base_language%"
ACTION_BASH_FOR "%scsroot%/%tra_base%/%base_language%" ".*\.tra" BEGIN
COPY "%BASH_FOR_FILESPEC%" "%scs_tra_loc%/%base_language%"
Expand All @@ -121,20 +124,16 @@ BEGIN
swedish => cp1252
tchinese => cp950
END

// when using HANDLE_CHARSETS with from_utf8 = 1, first remove all lines from the .gitattributes that contain 'working-tree-encoding=xxxxx'
LAF HANDLE_CHARSETS
INT_VAR
INT_VAR
from_utf8 = 1
infer_charsets = 0
STR_VAR
iconv_path tra_path = ~%scs_tra_loc%~
charset_table = charset_table
END
END
END ELSE BEGIN
// on non-EE, just set the tra loc
OUTER_SPRINT scs_tra_loc "%scsroot%/%tra_base%"
END
END
END
END
END

////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 22785b0

Please sign in to comment.