mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-15 22:07:34 +00:00
fix: Localize -> language.GetPhrase
This commit is contained in:
parent
0aa97895c5
commit
30b46dc1fe
|
@ -12,7 +12,7 @@ list.Set("DesktopWindows", "GmodIntegration:DesktopWindows", {
|
||||||
|
|
||||||
list.Set("DesktopWindows", "GmodIntegration:DesktopWindows:ReportBug", {
|
list.Set("DesktopWindows", "GmodIntegration:DesktopWindows:ReportBug", {
|
||||||
icon = "gmod_integration/logo_context_report.png",
|
icon = "gmod_integration/logo_context_report.png",
|
||||||
title = Localize("#gmod_integration.report_bug.title", "Report Bug"),
|
title = language.GetPhrase("gmod_integration.report_bug.title", "Report Bug"),
|
||||||
width = 960,
|
width = 960,
|
||||||
height = 700,
|
height = 700,
|
||||||
onewindow = true,
|
onewindow = true,
|
||||||
|
|
|
@ -1,35 +1,35 @@
|
||||||
local Fields = {
|
local Fields = {
|
||||||
{
|
{
|
||||||
["title"] = Localize("#gmod_integration.report_bug.title", "Report a bug"),
|
["title"] = language.GetPhrase("gmod_integration.report_bug.title", "Report a bug"),
|
||||||
["type"] = "image",
|
["type"] = "image",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
["title"] = Localize("#gmod_integration.report_bug.description", "Report a bug to the developers of this game."),
|
["title"] = language.GetPhrase("gmod_integration.report_bug.description", "Report a bug to the developers of this game."),
|
||||||
["type"] = "text",
|
["type"] = "text",
|
||||||
["dsc"] = Localize("#gmod_integration.report_bug.description.dsc", "Please provide as much information as possible to help us fix the issue."),
|
["dsc"] = language.GetPhrase("gmod_integration.report_bug.description.dsc", "Please provide as much information as possible to help us fix the issue."),
|
||||||
["tall"] = 80,
|
["tall"] = 80,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
["title"] = Localize("#gmod_integration.report_bug.importance_level", "Importance Level"),
|
["title"] = language.GetPhrase("gmod_integration.report_bug.importance_level", "Importance Level"),
|
||||||
["type"] = "dropdown",
|
["type"] = "dropdown",
|
||||||
["options"] = {Localize("#gmod_integration.report_bug.importance_level.critical", "Critical - Crash or made the game unplayable."), Localize("#gmod_integration.report_bug.importance_level.high", "High - Critical functionality is unusable."), Localize("#gmod_integration.report_bug.importance_level.medium", "Medium - Important functionality is unusable."), Localize("#gmod_integration.report_bug.importance_level.low", "Low - Cosmetic issue."), Localize("#gmod_integration.report_bug.importance_level.trivial", "Trivial - Very minor issue."),},
|
["options"] = {language.GetPhrase("gmod_integration.report_bug.importance_level.critical", "Critical - Crash or made the game unplayable."), language.GetPhrase("gmod_integration.report_bug.importance_level.high", "High - Critical functionality is unusable."), language.GetPhrase("gmod_integration.report_bug.importance_level.medium", "Medium - Important functionality is unusable."), language.GetPhrase("gmod_integration.report_bug.importance_level.low", "Low - Cosmetic issue."), language.GetPhrase("gmod_integration.report_bug.importance_level.trivial", "Trivial - Very minor issue."),},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
["title"] = Localize("#gmod_integration.report_bug.steps_to_reproduce", "Steps to Reproduce"),
|
["title"] = language.GetPhrase("gmod_integration.report_bug.steps_to_reproduce", "Steps to Reproduce"),
|
||||||
["type"] = "text",
|
["type"] = "text",
|
||||||
["dsc"] = Localize("#gmod_integration.report_bug.steps_to_reproduce.dsc", "Please provide a step-by-step guide on how to reproduce the bug."),
|
["dsc"] = language.GetPhrase("gmod_integration.report_bug.steps_to_reproduce.dsc", "Please provide a step-by-step guide on how to reproduce the bug."),
|
||||||
["tall"] = 80,
|
["tall"] = 80,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
["title"] = Localize("#gmod_integration.report_bug.expected_result", "Expected result"),
|
["title"] = language.GetPhrase("gmod_integration.report_bug.expected_result", "Expected result"),
|
||||||
["type"] = "text",
|
["type"] = "text",
|
||||||
["dsc"] = Localize("#gmod_integration.report_bug.expected_result.dsc", "What did you expect to happen?"),
|
["dsc"] = language.GetPhrase("gmod_integration.report_bug.expected_result.dsc", "What did you expect to happen?"),
|
||||||
["tall"] = 50,
|
["tall"] = 50,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
["title"] = Localize("#gmod_integration.report_bug.actual_result", "Actual result"),
|
["title"] = language.GetPhrase("gmod_integration.report_bug.actual_result", "Actual result"),
|
||||||
["type"] = "text",
|
["type"] = "text",
|
||||||
["dsc"] = Localize("#gmod_integration.report_bug.actual_result.dsc", "What actually happened?"),
|
["dsc"] = language.GetPhrase("gmod_integration.report_bug.actual_result.dsc", "What actually happened?"),
|
||||||
["tall"] = 50,
|
["tall"] = 50,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ function gmInte.openReportBug()
|
||||||
local frame = vgui.Create("DFrame")
|
local frame = vgui.Create("DFrame")
|
||||||
frame:SetSize(500, (700 / 1080) * ScrH())
|
frame:SetSize(500, (700 / 1080) * ScrH())
|
||||||
frame:Center()
|
frame:Center()
|
||||||
frame:SetTitle(gmInte.getFrameName(Localize("#gmod_integration.report_bug.title", "Report Bug")))
|
frame:SetTitle(gmInte.getFrameName(language.GetPhrase("gmod_integration.report_bug.title", "Report Bug")))
|
||||||
frame:MakePopup()
|
frame:MakePopup()
|
||||||
gmInte.applyPaint(frame)
|
gmInte.applyPaint(frame)
|
||||||
// bug report = screenshot, description, steps to reproduce, expected result, actual result
|
// bug report = screenshot, description, steps to reproduce, expected result, actual result
|
||||||
|
@ -83,7 +83,7 @@ function gmInte.openReportBug()
|
||||||
local dropdown = vgui.Create("DComboBox", dPanel)
|
local dropdown = vgui.Create("DComboBox", dPanel)
|
||||||
dropdown:Dock(TOP)
|
dropdown:Dock(TOP)
|
||||||
dropdown:DockMargin(5, 5, 5, 5)
|
dropdown:DockMargin(5, 5, 5, 5)
|
||||||
dropdown:SetValue(Localize("#gmod_integration.report_bug.importance_level.dsc", "How important is this bug?"))
|
dropdown:SetValue(language.GetPhrase("gmod_integration.report_bug.importance_level.dsc", "How important is this bug?"))
|
||||||
for i = 1, #field.options do
|
for i = 1, #field.options do
|
||||||
dropdown:AddChoice(field.options[i])
|
dropdown:AddChoice(field.options[i])
|
||||||
end
|
end
|
||||||
|
@ -108,7 +108,7 @@ function gmInte.openReportBug()
|
||||||
button.DoClick = function()
|
button.DoClick = function()
|
||||||
for _, element in ipairs(elements) do
|
for _, element in ipairs(elements) do
|
||||||
if element:GetText() == "" then
|
if element:GetText() == "" then
|
||||||
notification.AddLegacy(Localize("#gmod_integration.report_bug.error.missing_fields", "All fields are required"), NOTIFY_ERROR, 5)
|
notification.AddLegacy(language.GetPhrase("gmod_integration.report_bug.error.missing_fields", "All fields are required"), NOTIFY_ERROR, 5)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -133,9 +133,9 @@ function gmInte.openReportBug()
|
||||||
["expected"] = elements[4]:GetText(),
|
["expected"] = elements[4]:GetText(),
|
||||||
["actual"] = elements[5]:GetText(),
|
["actual"] = elements[5]:GetText(),
|
||||||
}, function()
|
}, function()
|
||||||
notification.AddLegacy(Localize("#gmod_integration.report_bug.success", "Bug report sent successfully"), NOTIFY_GENERIC, 5)
|
notification.AddLegacy(language.GetPhrase("gmod_integration.report_bug.success", "Bug report sent successfully"), NOTIFY_GENERIC, 5)
|
||||||
frame:Close()
|
frame:Close()
|
||||||
end, function() notification.AddLegacy(Localize("#gmod_integration.report_bug.error.failed", "Failed to send bug report retry later"), NOTIFY_ERROR, 5) end)
|
end, function() notification.AddLegacy(language.GetPhrase("gmod_integration.report_bug.error.failed", "Failed to send bug report retry later"), NOTIFY_ERROR, 5) end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user