Skip to content

Commit a9841fc

Browse files
Localize various elements (#2426)
* Localize some window texts * fix localization keys * Apply Suggestions by Rubat Co-Authored-By: Rubat <[email protected]> * Apply suggested changes by Rubat Co-Authored-By: Rubat <[email protected]> * Added suggestions by Rubat Co-Authored-By: Rubat <[email protected]> * Try to fix this entire PR * Add some more localizations * Undo some Duplicator changes Pending other changes * Update arming.lua --------- Co-authored-by: Rubat <[email protected]>
1 parent a19dd41 commit a9841fc

File tree

11 files changed

+44
-25
lines changed

11 files changed

+44
-25
lines changed

garrysmod/gamemodes/sandbox/entities/weapons/gmod_tool/stools/duplicator.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function TOOL:RightClick( trace )
117117
net.WriteUInt( 1, 1 )
118118
net.WriteVector( Dupe.Mins )
119119
net.WriteVector( Dupe.Maxs )
120-
net.WriteString( "Unsaved dupe" )
120+
net.WriteString( "#duplicator.dupe_unsaved" )
121121
net.WriteUInt( table.Count( Dupe.Entities ), 24 )
122122
net.WriteUInt( 0, 16 )
123123
net.Send( self:GetOwner() )
@@ -149,13 +149,13 @@ if ( CLIENT ) then
149149
if ( !tool && IsValid( LocalPlayer() ) ) then tool = LocalPlayer():GetTool( "duplicator" ) end
150150
if ( !tool || !tool.CurrentDupeName ) then return end
151151

152-
local info = "Name: " .. tool.CurrentDupeName
153-
info = info .. "\nEntities: " .. tool.CurrentDupeEntCount
152+
local info = language.GetPhrase( "duplicator.dupe_name" ) .. " " .. language.GetPhrase( tool.CurrentDupeName )
153+
info = info .. "\n" .. language.GetPhrase( "duplicator.dupe_entities" ) .. " " .. tool.CurrentDupeEntCount
154154

155155
CPanel:Help( info )
156156

157157
if ( tool.CurrentDupeWSIDs && #tool.CurrentDupeWSIDs > 0 ) then
158-
CPanel:Help( "Required workshop content:" )
158+
CPanel:Help( "#duplicator.dupe_required_content" )
159159
for _, wsid in pairs( tool.CurrentDupeWSIDs ) do
160160
local subbed = ""
161161
if ( steamworks.IsSubscribed( wsid ) ) then subbed = " (Subscribed)" end

garrysmod/gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/saves.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spawnmenu.AddCreationTab( "#spawnmenu.category.saves", function()
2525
file = "saves/" .. v,
2626
name = v:StripExtension(),
2727
preview = "saves/" .. v:StripExtension() .. ".jpg",
28-
description = "Local map saves stored on your computer. Local content can be deleted in the main menu."
28+
description = language.GetPhrase( "saves.local_description" )
2929
}
3030

3131
table.insert( saves, entry )
@@ -72,12 +72,12 @@ spawnmenu.AddCreationTab( "#spawnmenu.category.saves", function()
7272
if ( mapFile == game.GetMap() ) then
7373
RunConsoleCommand( "gm_load", filename )
7474
else
75-
local msg = string.format( "Loading this save will force a map change to %s. Do you wish to continue?", mapFile )
75+
local msg = string.format( language.GetPhrase( "saves.mapchange_message" ), mapFile )
7676

7777
Derma_Query( msg,
78-
"Please confirm loading this save",
79-
"Load", function() RunConsoleCommand( "gm_load", filename ) end,
80-
"Cancel" )
78+
language.GetPhrase( "saves.confirm_load_title" ),
79+
language.GetPhrase( "saves.dialog_load" ), function() RunConsoleCommand( "gm_load", filename ) end,
80+
language.GetPhrase( "dialog.cancel" ) )
8181
end
8282

8383
end

garrysmod/lua/derma/derma_utils.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function Derma_Message( strText, strTitle, strButtonText )
6464
ButtonPanel:SetPaintBackground( false )
6565

6666
local Button = vgui.Create( "DButton", ButtonPanel )
67-
Button:SetText( strButtonText or "OK" )
67+
Button:SetText( strButtonText or "#dialog.ok" )
6868
Button:SizeToContents()
6969
Button:SetTall( 20 )
7070
Button:SetWide( Button:GetWide() + 20 )
@@ -219,15 +219,15 @@ function Derma_StringRequest( strTitle, strText, strDefaultText, fnEnter, fnCanc
219219
ButtonPanel:SetPaintBackground( false )
220220

221221
local Button = vgui.Create( "DButton", ButtonPanel )
222-
Button:SetText( strButtonText or "OK" )
222+
Button:SetText( strButtonText or "#dialog.ok" )
223223
Button:SizeToContents()
224224
Button:SetTall( 20 )
225225
Button:SetWide( Button:GetWide() + 20 )
226226
Button:SetPos( 5, 5 )
227227
Button.DoClick = function() Window:Close() fnEnter( TextEntry:GetValue() ) end
228228

229229
local ButtonCancel = vgui.Create( "DButton", ButtonPanel )
230-
ButtonCancel:SetText( strButtonCancelText or "Cancel" )
230+
ButtonCancel:SetText( strButtonCancelText or "#dialog.cancel" )
231231
ButtonCancel:SizeToContents()
232232
ButtonCancel:SetTall( 20 )
233233
ButtonCancel:SetWide( Button:GetWide() + 20 )

garrysmod/lua/menu/mainmenu.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ function GetServers( category, id )
434434
local version = string.JavascriptSafe( tostring( VERSION ) )
435435

436436
SendServer( pnlMainMenu, category, id,
437-
2000, language.GetPhrase("server_noresponse"):format(address), language.GetPhrase("server_gamemode_unreachable"), "no_map", 0, 2, 0, "false", 0, address, "unkn", "0",
437+
2000, language.GetPhrase( "server_noresponse" ):format( address ), language.GetPhrase( "server_gamemode_unreachable" ), "no_map", 0, 2, 0, "false", 0, address, "unkn", "0",
438438
"true", version, tostring( serverlist.IsServerFavorite( address ) ), "", "" )
439439

440440
return !ShouldStop[ category ]
@@ -658,11 +658,11 @@ hook.Add( "GameContentChanged", "RefreshMainMenu", function()
658658

659659
end )
660660

661-
hook.Add( "LoadGModSaveFailed", "LoadGModSaveFailed", function( str, wsid )
661+
hook.Add( "LoadGModSaveFailed", "HandleUGCLoadFailure", function( str, wsid )
662662
local button2 = nil
663-
if ( wsid and wsid:len() > 0 and wsid != "0" ) then button2 = "Open map on Steam Workshop" end
663+
if ( wsid and wsid:len() > 0 and wsid != "0" ) then button2 = "#ugc.open_map" end
664664

665-
Derma_Query( str, "Failed to load save!", "OK", nil, button2, function() steamworks.ViewFile( wsid ) end )
665+
Derma_Query( str, "#ugc.load_failed", "#dialog.ok", nil, button2, function() steamworks.ViewFile( wsid ) end )
666666
gui.ActivateGameUI()
667667
end )
668668

garrysmod/lua/menu/menu_demo.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function demo:FetchLocal( offset, perpage )
1616
file = "demos/" .. v,
1717
name = v:StripExtension(),
1818
preview = "demos/" .. v:StripExtension() .. ".jpg",
19-
description = "Local demo stored on your computer. Local content can be deleted in the main menu."
19+
description = language.GetPhrase( "demos.local_description" )
2020
}
2121

2222
table.insert( saves, entry )
@@ -36,7 +36,7 @@ end
3636
function demo:DownloadAndPlay( id )
3737

3838
steamworks.DownloadUGC( id, function( name )
39-
if ( !name ) then hook.Call( "LoadGModSaveFailed", nil, "Failed to download demo from Steam Workshop!" ) return end
39+
if ( !name ) then hook.Call( "LoadGModSaveFailed", nil, language.GetPhrase( "ugc.download_failed" ) ) return end
4040

4141
self:Play( name )
4242

@@ -54,7 +54,7 @@ end
5454
function demo:DownloadAndToVideo( id )
5555

5656
steamworks.DownloadUGC( id, function( name )
57-
if ( !name ) then hook.Call( "LoadGModSaveFailed", nil, "Failed to download demo from Steam Workshop!" ) return end
57+
if ( !name ) then hook.Call( "LoadGModSaveFailed", nil, language.GetPhrase( "ugc.download_failed" ) ) return end
5858

5959
self:ToVideo( name )
6060

@@ -72,7 +72,7 @@ end
7272
function demo:FinishPublish( filename, imagename, name, desc, chosenTag, other )
7373

7474
local info = GetDemoFileDetails( filename )
75-
if ( !info ) then return "Couldn't get demo information!" end
75+
if ( !info ) then return "#ugc_upload.error.demo_info" end
7676

7777
steamworks.Publish( filename, imagename, name, desc, { "demo", info.mapname }, other.Callback, other.WorkshopID, other.ChangeNotes )
7878

garrysmod/lua/menu/menu_dupe.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function ws_dupe:FetchLocal( offset, perpage )
1616
file = "dupes/" .. v,
1717
name = v:StripExtension(),
1818
preview = "dupes/" .. v:StripExtension() .. ".jpg",
19-
description = "Local duplication stored on your computer. Local content can be deleted in the main menu."
19+
description = language.GetPhrase( "dupes.local_description" )
2020
}
2121

2222
table.insert( saves, entry )

garrysmod/lua/menu/menu_save.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function ws_save:FetchLocal( offset, perpage )
1616
file = "saves/" .. v,
1717
name = v:StripExtension(),
1818
preview = "saves/" .. v:StripExtension() .. ".jpg",
19-
description = "Local map save stored on your computer. Local content can be deleted in the main menu."
19+
description = language.GetPhrase( "saves.local_description" )
2020
}
2121

2222
table.insert( saves, entry )
@@ -37,7 +37,7 @@ function ws_save:DownloadAndLoad( id )
3737

3838
steamworks.DownloadUGC( id, function( name )
3939

40-
if ( !name ) then hook.Call( "LoadGModSaveFailed", nil, "Failed to download save from Steam Workshop!" ) return end
40+
if ( !name ) then hook.Call( "LoadGModSaveFailed", nil, language.GetPhrase( "ugc.download_failed" ) ) return end
4141

4242
ws_save:Load( name )
4343

@@ -54,7 +54,7 @@ end
5454
function ws_save:FinishPublish( filename, imagename, name, desc, chosenTag, other )
5555

5656
local info = GetSaveFileDetails( filename )
57-
if ( !info ) then return "Couldn't get save information!" end
57+
if ( !info ) then return "#ugc_upload.error.save_info" end
5858

5959
steamworks.Publish( filename, imagename, name, desc, { "save", info.map, chosenTag }, other.Callback, other.WorkshopID, other.ChangeNotes )
6060

garrysmod/lua/menu/openurl.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function PANEL_Browser:Init()
1616
self.HTML:Dock( FILL )
1717
--self.HTML:SetOpenLinksExternally( true )
1818

19-
self:SetTitle( "Steam overlay replacement" )
19+
self:SetTitle( "#openurl.overlay_replacement_title" )
2020
self:SetSize( ScrW() * 0.75, ScrH() * 0.75 )
2121
self:SetSizable( true )
2222
self:Center()

garrysmod/resource/localization/en/community.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,7 @@ sort.newest=Newest
984984
sort.oldest=Oldest
985985
category.featured=Featured
986986
dialog.ok=OK
987+
dialog.cancel=Cancel
987988

988989
#Singular of main_menu's "saves=Saves". Not the concept of saving, but the concept of a singluar Save.
989990
saves.singular=Save

garrysmod/resource/localization/en/main_menu.properties

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,10 @@ saves.machines=Machines
253253
saves.courses=Courses
254254
saves.buildings=Buildings
255255
saves.others=Others
256+
saves.local_description=Local map save stored on your computer. Local content can be deleted in the main menu.
257+
saves.mapchange_message=Loading this save will force a map change to %s. Do you wish to continue?
258+
saves.confirm_load_title=Please confirm loading this save
259+
saves.dialog_load=Load
256260
save.savegame=Save Game
257261

258262
ugc.install=install
@@ -270,6 +274,9 @@ ugc.XoutofY=%s of %s
270274
ugc.mounting=Mounting Workshop content, please wait...
271275
ugc.fetching=Fetching Subscriptions...
272276
ugc.disabled=Workshop content is disabled by -noworkshop launch option!
277+
ugc.download_failed=Failed to download the file from Steam Workshop!
278+
ugc.load_failed=Failed to load Steam Workshop content
279+
ugc.open_map=Open map on Steam Workshop
273280

274281
demos=Demos
275282
demos.local=My Demos
@@ -298,6 +305,7 @@ demos.followed=Followed
298305
demos.followed.subtitle=The latest demos from your favorite Workshop creators
299306
demos.favorite=Favorites
300307
demos.favorite.subtitle=Your favorite demos
308+
demos.local_description=Local demo stored on your computer. Local content can be deleted in the main menu.
301309

302310
addons.subscribed=Subscribed
303311
addons.subscribed.subtitle=Addons that you're subscribed to
@@ -434,6 +442,7 @@ dupes.others=Others
434442
dupes.subscribed_ugc=Subscribed
435443
dupes.subscribed_ugc.subtitle=Dupes that you're subscribed to
436444
dupes.openfolder=Open Dupes Folder
445+
dupes.local_description=Local duplication stored on your computer. Local content can be deleted in the main menu.
437446

438447
motionsensor.showcolor=Show Video Box
439448
motionsensor.colorpos=Video Position\:
@@ -457,6 +466,8 @@ openurl.yes_remember=Don't ask again for this server
457466
openurl.nope=Nope
458467
openurl.disconnect=Disconnect
459468
469+
openurl.overlay_replacement_title=Steam overlay replacement
470+
460471
ugc_upload.frametitle=Publish creation to Steam Workshop
461472
ugc_upload.title=Title\:
462473
ugc_upload.description=Description\:
@@ -479,6 +490,8 @@ ugc_upload.tag_courses=Course
479490
ugc_upload.tag_posed=Pose / Ragdoll
480491
ugc_upload.publishing=Publishing your content, please wait...
481492
ugc_upload.error.title=Error while publishing content!
493+
ugc_upload.error.save_info=Couldn't get save information!
494+
ugc_upload.error.demo_info=Couldn't get demo information!
482495
483496
option_crosshair.title=Default Crosshair Setup
484497
option_crosshair.style_hl2=Half-Life 2

0 commit comments

Comments
 (0)