Skip to content

Commit

Permalink
More localization
Browse files Browse the repository at this point in the history
  • Loading branch information
theace0296 committed Oct 25, 2021
1 parent 7d9ae2a commit c7a407f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
4 changes: 2 additions & 2 deletions RandFramework/Client/camera/fn_postStartMissionCamera.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ if (hasInterface && {!((player getVariable ["TRGM_postStartMissionCamRunning", "
private _LineFour = (localize "STR_TRGM2_StartMission_Time") + str(_time24);

if (_isHiddenObj) then {
_LineTwo = (localize "STR_TRGM2_StartMission_Mission") + "Unknown";
_LineThree = "location unknown"
_LineTwo = (localize "STR_TRGM2_StartMission_Mission") + (localize "STR_TRGM2_StartMission_MissionUnknown");
_LineThree = localize "STR_TRGM2_StartMission_LocationUnknown";
};

if (!(TRGM_VAR_iMissionIsCampaign)) then {
Expand Down
2 changes: 1 addition & 1 deletion RandFramework/Global/reputation/fn_checkBadPoints.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ while {true} do {
};
sleep 2;

[TRGM_VAR_FriendlySide, ["DeBrief", localize "STR_TRGM2_mainInit_Debrief", "Debrief", ""]] call FHQ_fnc_ttAddTasks;
[TRGM_VAR_FriendlySide, [localize "STR_TRGM2_mainInit_DebriefTitle", localize "STR_TRGM2_mainInit_Debrief", localize "STR_TRGM2_mainInit_DebriefTitle", ""]] call FHQ_fnc_ttAddTasks;
};
if (_dCurrentRep <= 0 && {TRGM_VAR_iMissionParamRepOption isEqualTo 0}) then { //note... when gaining rep, we increase the TRGM_VAR_MaxBadPoints, and when lower, we incrase TRGM_VAR_BadPoints (rep is calulated by the difference)
["tskKeepAboveAverage", "failed"] call FHQ_fnc_ttSetTaskState;
Expand Down
22 changes: 19 additions & 3 deletions Tools/sqflint.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,23 @@ def parse(script):
tokens = [identify_token(x) for x in parsed_tokens]
strings = list(filter(lambda x:
isinstance(x, String) and
x.value.strip() != '' and
'_' not in x.value and
':' not in x.value and
'\n' not in x.value,
'\n' not in x.value and
'.sqf' not in x.value and
'=' not in x.value and
x.value != x.value.upper() and
x.value != x.value.lower(),
parsed_tokens))
if len(strings) > 0:
for x in strings:
if x.value not in unique_strings:
hasKeyword = False
for keyword in KEYWORDS:
if keyword in x.value:
hasKeyword = True
break
if x.value not in unique_strings and not hasKeyword:
unique_strings.append(x.value)

result = parse_block(tokens + [EndOfFile()], _analyze_tokens)[0]
Expand Down Expand Up @@ -157,7 +167,13 @@ def entry_point(args):

with open(f'{args.directory.rstrip("/")}\\sqflint.log', 'a') as log:
for string in unique_strings:
log.write(string)
log.write(f'<Key ID="STR_TRGM2_{string.replace(" ", "_")}">')
log.write('\n')
log.write(f' <Original>{string}</Original>')
log.write('\n')
log.write(f' <English>{string}</English>')
log.write('\n')
log.write('</Key>')
log.write('\n')
log.close()

Expand Down
12 changes: 12 additions & 0 deletions stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,10 @@
<Spanish>Vuelve a la base principal (CG) para debrief</Spanish>
<Korean>보고를 위해 HQ로 복귀하세요</Korean>
</Key>
<Key ID="STR_TRGM2_mainInit_DebriefTitle">
<Original>DeBrief</Original>
<English>DeBrief</English>
</Key>
<Key ID="STR_TRGM2_mainInit_ReputationDropped">
<Original>Your reputation has dropped. Team rank now: </Original>
<English>Your reputation has dropped. Team rank now: </English>
Expand Down Expand Up @@ -1457,6 +1461,14 @@
<Spanish>Misión: </Spanish>
<Korean>임무: </Korean>
</Key>
<Key ID="STR_TRGM2_StartMission_MissionUnknown">
<Original>Unknown</Original>
<English>Unknown</English>
</Key>
<Key ID="STR_TRGM2_StartMission_LocationUnknown">
<Original>Location Unknown</Original>
<English>Location Unknown</English>
</Key>
<Key ID="STR_TRGM2_StartMission_Time">
<Original>Time: </Original>
<English>Time: </English>
Expand Down

0 comments on commit c7a407f

Please sign in to comment.