diff --git a/client/camera.lua b/client/camera.lua index f58af18..49d0b18 100644 --- a/client/camera.lua +++ b/client/camera.lua @@ -254,9 +254,9 @@ CreateThread(function() end local vehicle = cache.vehicle local cam2 = CreateCam('DEFAULT_SCRIPTED_FLY_CAMERA', true) - local msg = Lang:t('info.title_breaking_news') - local bottom = Lang:t('info.bottom_breaking_news') - local title = Lang:t('info.breaking_news') + local msg =locale('info.title_breaking_news') + local bottom =locale('info.bottom_breaking_news') + local title =locale('info.breaking_news') AttachCamToEntity(cam2, cache.ped, 0.0,0.0,1.0, true) SetCamRot(cam2, 2.0,1.0,GetEntityHeading(cache.ped), 0) SetCamFov(cam2, fov) diff --git a/client/main.lua b/client/main.lua index df1bcef..b1c33cb 100644 --- a/client/main.lua +++ b/client/main.lua @@ -21,7 +21,7 @@ local function setLocationBlip() end local function takeOutVehicle(vehType, coords) - local netId = lib.callback.await('qbx_newsjob:server:spawnVehicle', false, vehType, coords, Lang:t('info.news_plate')..tostring(math.random(1000, 9999)), true) + local netId = lib.callback.await('qbx_newsjob:server:spawnVehicle', false, vehType, coords,locale('info.news_plate')..tostring(math.random(1000, 9999)), true) local timeout = 100 while not NetworkDoesEntityExistWithNetworkId(netId) and timeout > 0 do Wait(10) @@ -59,7 +59,7 @@ local function menuVehicleGarage() lib.registerContext({ id = 'weazel_garage_context_menu', - title = Lang:t('info.weazel_news_vehicles'), + title =locale('info.weazel_news_vehicles'), options = optionsMenu }) @@ -82,7 +82,7 @@ local function menuHeliGarage() lib.registerContext({ id = 'weazel_heli_context_menu', - title = Lang:t('info.weazel_news_helicopters'), + title =locale('info.weazel_news_helicopters'), options = optionsMenu }) @@ -104,7 +104,7 @@ local function registerMainEntrance() icon = 'fa-solid fa-house', type = 'client', event = 'qbx_newsjob:client:target:enterLocation', - label = Lang:t("info.enter"), + label =locale("info.enter"), distance = 1 }, }, @@ -146,7 +146,7 @@ local function registerMainExit() icon = 'fa-solid fa-house', type = 'client', event = 'qbx_newsjob:client:target:exitLocation', - label = Lang:t("info.go_outside"), + label =locale("info.go_outside"), distance = 1 }, }, @@ -202,7 +202,7 @@ local function registerEnterRoof() icon = 'fa-solid fa-house', type = 'client', event = 'qbx_newsjob:client:target:enterRoof', - label = Lang:t("info.roof_enter"), + label =locale("info.roof_enter"), distance = 1 }, }, @@ -258,7 +258,7 @@ local function registerExitRoof() icon = 'fa-solid fa-house', type = 'client', event = 'qbx_newsjob:client:target:exitRoof', - label = Lang:t("info.roof_exit"), + label =locale("info.roof_exit"), distance = 1 }, }, diff --git a/fxmanifest.lua b/fxmanifest.lua index b0bcfd7..e8867bc 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -8,9 +8,7 @@ version '1.0.1' shared_scripts { '@ox_lib/init.lua', '@qbx_core/modules/lib.lua', - '@qbx_core/shared/locale.lua', - 'locales/en.lua', - 'locales/*.lua', + } client_scripts { @@ -28,4 +26,5 @@ files { } lua54 'yes' -use_experimental_fxv2_oal 'yes' \ No newline at end of file +use_experimental_fxv2_oal 'yes' +ox_lib 'locale' \ No newline at end of file diff --git a/locales/cs.json b/locales/cs.json new file mode 100644 index 0000000..8852b5a --- /dev/null +++ b/locales/cs.json @@ -0,0 +1,28 @@ +{ + "error": { + "cant_spawn_vehicle": "Něco se pokazilo při spawnování vozidla", + "no_access": "K tomuto příkazu nemáte přístup." + }, + "info": { + "weazle_overlay": "Weazel Overlay: \nFilm Overlay: [E] \nFilm Overlay: [M]", + "weazel_news_vehicles": "Weazel News Vozidlo", + "close_menu": "⬅ Zavřít menu", + "weazel_news_helicopters": "Weazel News Helikoptéra", + "store_vehicle": "[E] - Uložit vozidlo", + "vehicles": "[E] - Vehicles", + "store_helicopters": "[E] - Vytáhnout helikoptéru", + "helicopters": "[E] - Helikoptéra", + "enter": "[E] - Vstupte", + "go_outside": "[E] - Jdi ven", + "roof_enter": "[E] - Vstup na střechu", + "roof_exit": "[E] - Opustit střechu", + "breaking_news": "BREAKING NEWS", + "title_breaking_news": "Weazel Today - Breaking News Výhradní", + "bottom_breaking_news": "Přinášíme vám NEJVĚTŠÍ ZPRÁVY živě, jak se dějí", + "newscam": "Uchopte zpravodajskou kameru", + "newsmic": "Chyťte si zpravodajský mikrofon", + "newsbmic": "Uchopte mikrofon Boom", + "news_plate": "WZNW", + "blip_name": "Weazel News" + } +} diff --git a/locales/cs.lua b/locales/cs.lua deleted file mode 100644 index 396e8a6..0000000 --- a/locales/cs.lua +++ /dev/null @@ -1,37 +0,0 @@ -local Translations = { - error = { - cant_spawn_vehicle = 'Něco se pokazilo při spawnování vozidla', - no_access = 'K tomuto příkazu nemáte přístup.' - }, - info = { - weazle_overlay = 'Weazel Overlay: \nFilm Overlay: [E] \nFilm Overlay: [M]', - weazel_news_vehicles = 'Weazel News Vozidlo', - close_menu = '⬅ Zavřít menu', - weazel_news_helicopters = 'Weazel News Helikoptéra', - store_vehicle = '[E] - Uložit vozidlo', - vehicles = '[E] - Vehicles', - store_helicopters = '[E] - Vytáhnout helikoptéru', - helicopters = '[E] - Helikoptéra', - enter = "[E] - Vstupte", - go_outside = "[E] - Jdi ven", - roof_enter = "[E] - Vstup na střechu", - roof_exit = "[E] - Opustit střechu", - breaking_news = 'BREAKING NEWS', - title_breaking_news = 'Weazel Today - Breaking News Výhradní', - bottom_breaking_news = 'Přinášíme vám NEJVĚTŠÍ ZPRÁVY živě, jak se dějí', - newscam = 'Uchopte zpravodajskou kameru', - newsmic = 'Chyťte si zpravodajský mikrofon', - newsbmic = 'Uchopte mikrofon Boom', - news_plate = 'WZNW', --Mělo by mít pouze 4 znaky - blip_name = 'Weazel News', - }, -} - -if GetConvar('qb_locale', 'en') == 'cs' then - Lang = Locale:new({ - phrases = Translations, - warnOnMissing = true, - fallbackLang = Lang, - }) -end ---translate by stepan_valic diff --git a/locales/en.json b/locales/en.json new file mode 100644 index 0000000..e3a423b --- /dev/null +++ b/locales/en.json @@ -0,0 +1,28 @@ +{ + "error": { + "cant_spawn_vehicle": "Something went wrong spawning the vehicle", + "no_access": "You don't have access to this command." + }, + "info": { + "weazle_overlay": "Weazel Overlay: [E] \nFilm Overlay: [M]", + "weazel_news_vehicles": "Weazel News Vehicles", + "close_menu": "⬅ Close Menu", + "weazel_news_helicopters": "Weazel News Helicopters", + "store_vehicle": "[E] - Store the Vehicle", + "vehicles": "[E] - Vehicles", + "store_helicopters": "[E] - Store the Helicopters", + "helicopters": "[E] - Helicopters", + "enter": "[E] - Enter", + "go_outside": "[E] - Go outside", + "roof_enter": "[E] - Enter roof", + "roof_exit": "[E] - Exit roof", + "breaking_news": "BREAKING NEWS", + "title_breaking_news": "Weazel Today - Breaking News Exclusive", + "bottom_breaking_news": "We bring you the LATEST NEWS live as it happens", + "newscam": "Grab a news camera", + "newsmic": "Grab a news microphone", + "newsbmic": "Grab a Boom microphone", + "news_plate": "WZNW", + "blip_name": "Weazel News" + } +} diff --git a/locales/en.lua b/locales/en.lua deleted file mode 100644 index 8ce85ff..0000000 --- a/locales/en.lua +++ /dev/null @@ -1,33 +0,0 @@ -local Translations = { - error = { - cant_spawn_vehicle = 'Something went wrong spawning the vehicle', - no_access = 'You don\'t have access to this command.' - }, - info = { - weazle_overlay = 'Weazel Overlay: [E] \nFilm Overlay: [M]', - weazel_news_vehicles = 'Weazel News Vehicles', - close_menu = '⬅ Close Menu', - weazel_news_helicopters = 'Weazel News Helicopters', - store_vehicle = '[E] - Store the Vehicle', - vehicles = '[E] - Vehicles', - store_helicopters = '[E] - Store the Helicopters', - helicopters = '[E] - Helicopters', - enter = '[E] - Enter', - go_outside = '[E] - Go outside', - roof_enter = '[E] - Enter roof', - roof_exit = '[E] - Exit roof', - breaking_news= 'BREAKING NEWS', - title_breaking_news = 'Weazel Today - Breaking News Exclusive', - bottom_breaking_news = 'We bring you the LATEST NEWS live as it happens', - newscam = 'Grab a news camera', - newsmic = 'Grab a news microphone', - newsbmic = 'Grab a Boom microphone', - news_plate = 'WZNW', --Should only be 4 characters long - blip_name = 'Weazel News', - }, -} - -Lang = Lang or Locale:new({ - phrases = Translations, - warnOnMissing = true -}) \ No newline at end of file diff --git a/locales/es.json b/locales/es.json new file mode 100644 index 0000000..823e742 --- /dev/null +++ b/locales/es.json @@ -0,0 +1,27 @@ +{ + "error": { + "cant_spawn_vehicle": "Something went wrong spawning the vehicle", + "no_access": "You don't have access to this command." + }, + "info": { + "weazle_overlay": "Transmitir noticia en vivo ~INPUT_PICKUP~ \nGrabar noticia: ~INPUT_INTERACTION_MENU~", + "weazel_news_vehicles": "Vehículos Weazel News", + "close_menu": "⬅ Cerrar menu", + "weazel_news_helicopters": "Helicopteros Weazel News", + "store_vehicle": "[E] - Guardar vehículo", + "vehicles": "[E] - Vehículos", + "store_helicopters": "[E] - Guardar Helicoptero", + "helicopters": "[E] - Helicopteros", + "enter": "[E] - Entrar", + "go_outside": "[E] - Salir", + "roof_enter": "[E] - Enter roof", + "roof_exit": "[E] - Exit roof", + "breaking_news": "¡NOTICIA DE ULTIMA HORA!", + "title_breaking_news": "Weazel Today - Noticia de ultima hora", + "bottom_breaking_news": "Te traemos las ultimas noticias en vivo", + "newscam": "Grab a news camera", + "newsmic": "Grab a news microphone", + "newsbmic": "Grab a Boom microphone", + "news_plate": "WZNW" + } +} diff --git a/locales/es.lua b/locales/es.lua deleted file mode 100644 index 6745df1..0000000 --- a/locales/es.lua +++ /dev/null @@ -1,35 +0,0 @@ -local Translations = { - error = { - cant_spawn_vehicle = 'Something went wrong spawning the vehicle', - no_access = 'You don\'t have access to this command.' - }, - info = { - weazle_overlay = 'Transmitir noticia en vivo ~INPUT_PICKUP~ \nGrabar noticia: ~INPUT_INTERACTION_MENU~', - weazel_news_vehicles = 'Vehículos Weazel News', - close_menu = '⬅ Cerrar menu', - weazel_news_helicopters = 'Helicopteros Weazel News', - store_vehicle = '[E] - Guardar vehículo', - vehicles = '[E] - Vehículos', - store_helicopters = '[E] - Guardar Helicoptero', - helicopters = '[E] - Helicopteros', - enter = '[E] - Entrar', - go_outside = '[E] - Salir', - roof_enter = '[E] - Enter roof', - roof_exit = '[E] - Exit roof', - breaking_news= '¡NOTICIA DE ULTIMA HORA!', - title_breaking_news = 'Weazel Today - Noticia de ultima hora', - bottom_breaking_news = 'Te traemos las ultimas noticias en vivo', - newscam = 'Grab a news camera', - newsmic = 'Grab a news microphone', - newsbmic = 'Grab a Boom microphone', - news_plate = 'WZNW', --Should only be 4 characters long - }, -} - -if GetConvar('qb_locale', 'en') == 'es' then - Lang = Locale:new({ - phrases = Translations, - warnOnMissing = true, - fallbackLang = Lang, - }) -end \ No newline at end of file diff --git a/locales/fr.json b/locales/fr.json new file mode 100644 index 0000000..acf8eb4 --- /dev/null +++ b/locales/fr.json @@ -0,0 +1,27 @@ +{ + "error": { + "cant_spawn_vehicle": "Something went wrong spawning the vehicle", + "no_access": "You don't have access to this command." + }, + "info": { + "weazle_overlay": "Overlay Weazel ~INPUT_PICKUP~ \nOverlay Film: ~INPUT_INTERACTION_MENU~", + "weazel_news_vehicles": "Vehicules Weazel-News", + "close_menu": "⬅ Fermer Menu", + "weazel_news_helicopters": "Hélicoptère Weazel News", + "store_vehicle": "[E] - Garer le véhicule", + "vehicles": "[E] - Véhicules", + "store_helicopters": "[E] - Garer l'hélicoptère", + "helicopters": "[E] - Hélicoptères", + "enter": "[E] - Entrer", + "go_outside": "[E] - Sortir", + "roof_enter": "[E] - Enter roof", + "roof_exit": "[E] - Exit roof", + "breaking_news": "BREAKING NEWS", + "title_breaking_news": "Weazel Today - Breaking News Exclusive", + "bottom_breaking_news": "We bring you the LATEST NEWS live as it happens", + "newscam": "Grab a news camera", + "newsmic": "Grab a news microphone", + "newsbmic": "Grab a Boom microphone", + "news_plate": "WZNW" + } +} diff --git a/locales/fr.lua b/locales/fr.lua deleted file mode 100644 index f4dfccf..0000000 --- a/locales/fr.lua +++ /dev/null @@ -1,35 +0,0 @@ -local Translations = { - error = { - cant_spawn_vehicle = 'Something went wrong spawning the vehicle', - no_access = 'You don\'t have access to this command.' - }, - info = { - weazle_overlay = 'Overlay Weazel ~INPUT_PICKUP~ \nOverlay Film: ~INPUT_INTERACTION_MENU~', - weazel_news_vehicles = 'Vehicules Weazel-News', - close_menu = '⬅ Fermer Menu', - weazel_news_helicopters = 'Hélicoptère Weazel News', - store_vehicle = '[E] - Garer le véhicule', - vehicles = '[E] - Véhicules', - store_helicopters = '[E] - Garer l\'hélicoptère', - helicopters = '[E] - Hélicoptères', - enter = '[E] - Entrer', - go_outside = '[E] - Sortir', - roof_enter = '[E] - Enter roof', - roof_exit = '[E] - Exit roof', - breaking_news = 'BREAKING NEWS', - title_breaking_news = 'Weazel Today - Breaking News Exclusive', - bottom_breaking_news = 'We bring you the LATEST NEWS live as it happens', - newscam = 'Grab a news camera', - newsmic = 'Grab a news microphone', - newsbmic = 'Grab a Boom microphone', - news_plate = 'WZNW', --Should only be 4 characters long - } -} - -if GetConvar('qb_locale', 'en') == 'fr' then - Lang = Locale:new({ - phrases = Translations, - warnOnMissing = true, - fallbackLang = Lang, - }) -end \ No newline at end of file diff --git a/locales/pt-br.json b/locales/pt-br.json new file mode 100644 index 0000000..a7deb0b --- /dev/null +++ b/locales/pt-br.json @@ -0,0 +1,28 @@ +{ + "error": { + "cant_spawn_vehicle": "Algo deu errado ao spawnar o veículo", + "no_access": "Você não tem acesso a este comando." + }, + "info": { + "weazle_overlay": "Sobreposição Weazel: [E] \nSobreposição de Filme: [M]", + "weazel_news_vehicles": "Veículos da Weazel News", + "close_menu": "⬅ Fechar Menu", + "weazel_news_helicopters": "Helicópteros da Weazel News", + "store_vehicle": "[E] - Guardar o Veículo", + "vehicles": "[E] - Veículos", + "store_helicopters": "[E] - Guardar os Helicópteros", + "helicopters": "[E] - Helicópteros", + "enter": "[E] - Entrar", + "go_outside": "[E] - Sair", + "roof_enter": "[E] - Entrar no telhado", + "roof_exit": "[E] - Sair do telhado", + "breaking_news": "NOTÍCIAS DE URGÊNCIA", + "title_breaking_news": "Weazel Hoje - Exclusivo de Notícias de Urgência", + "bottom_breaking_news": "Trazemos as NOTÍCIAS MAIS RECENTES ao vivo conforme acontecem", + "newscam": "Pegue uma câmera de notícias", + "newsmic": "Pegue um microfone de notícias", + "newsbmic": "Pegue um microfone Boom", + "news_plate": "WZNW", + "blip_name": "Weazel News" + } +} diff --git a/locales/pt.json b/locales/pt.json new file mode 100644 index 0000000..a29ee74 --- /dev/null +++ b/locales/pt.json @@ -0,0 +1,28 @@ +{ + "error": { + "cant_spawn_vehicle": "Algo correu mal ao gerar o veículo", + "no_access": "Não tens acesso a este comando." + }, + "info": { + "weazle_overlay": "Weazel Overlay: [E] \nFilm Overlay: [M]", + "weazel_news_vehicles": "Veículos Weazel News", + "close_menu": "⬅ Fechar Menu", + "weazel_news_helicopters": "Helicópteros Weazel News", + "store_vehicle": "[E] - Guardar o Veículo", + "vehicles": "[E] - Veículos", + "store_helicopters": "[E] - Guardar os Helicópteros", + "helicopters": "[E] - Helicópteros", + "enter": "[E] - Entrar", + "go_outside": "[E] - Sair", + "roof_enter": "[E] - Entrar no telhado", + "roof_exit": "[E] - Sair do telhado", + "breaking_news": "ÚLTIMAS NOTÍCIAS", + "title_breaking_news": "Weazel Today - Exclusivo Últimas Notícias", + "bottom_breaking_news": "Trazemos-Te AS ÚLTIMAS NOTÍCIAS em direto à medida que acontecem", + "newscam": "Pegar numa câmara de notícias", + "newsmic": "Pegar num microfone de notícias", + "newsbmic": "Pegar num microfone boom", + "news_plate": "WZNW", + "blip_name": "Weazel News" + } +} diff --git a/locales/pt.lua b/locales/pt.lua deleted file mode 100644 index 79d0817..0000000 --- a/locales/pt.lua +++ /dev/null @@ -1,36 +0,0 @@ -local Translations = { - error = { - cant_spawn_vehicle = 'Algo correu mal ao gerar o veículo', - no_access = 'Não tens acesso a este comando.' - }, - info = { - weazle_overlay = 'Weazel Overlay: [E] \nFilm Overlay: [M]', - weazel_news_vehicles = 'Veículos Weazel News', - close_menu = '⬅ Fechar Menu', - weazel_news_helicopters = 'Helicópteros Weazel News', - store_vehicle = '[E] - Guardar o Veículo', - vehicles = '[E] - Veículos', - store_helicopters = '[E] - Guardar os Helicópteros', - helicopters = '[E] - Helicópteros', - enter = '[E] - Entrar', - go_outside = '[E] - Sair', - roof_enter = '[E] - Entrar no telhado', - roof_exit = '[E] - Sair do telhado', - breaking_news= 'ÚLTIMAS NOTÍCIAS', - title_breaking_news = 'Weazel Today - Exclusivo Últimas Notícias', - bottom_breaking_news = 'Trazemos-Te AS ÚLTIMAS NOTÍCIAS em direto à medida que acontecem', - newscam = 'Pegar numa câmara de notícias', - newsmic = 'Pegar num microfone de notícias', - newsbmic = 'Pegar num microfone boom', - news_plate = 'WZNW', -- Deve ter apenas 4 caracteres - blip_name = 'Weazel News', - }, -} - -if GetConvar('qb_locale', 'en') == 'pt' then - Lang = Locale:new({ - phrases = Translations, - warnOnMissing = true, - fallbackLang = Lang, - }) -end diff --git a/server/main.lua b/server/main.lua index 73690d6..ee21dd9 100644 --- a/server/main.lua +++ b/server/main.lua @@ -4,30 +4,30 @@ local function checkReporterJob(source) end lib.addCommand('newscam', { - help = Lang:t('info.newscam'), + help = locale('info.newscam'), }, function(source) if not checkReporterJob(source) then - TriggerClientEvent('ox_lib:notify', source, { description = Lang:t('error.no_access'), type = 'error' }) + TriggerClientEvent('ox_lib:notify', source, { description = locale('error.no_access'), type = 'error' }) return end TriggerClientEvent('qbx_newsjob:client:toggleCam', source) end) lib.addCommand('newsmic', { - help = Lang:t('info.newsmic'), + help = locale('info.newsmic'), }, function(source) if not checkReporterJob(source) then - TriggerClientEvent('ox_lib:notify', source, { description = Lang:t('error.no_access'), type = 'error' }) + TriggerClientEvent('ox_lib:notify', source, { description = locale('error.no_access'), type = 'error' }) return end TriggerClientEvent('qbx_newsjob:client:toggleMic', source) end) lib.addCommand('newsbmic', { - help = Lang:t('info.newsbmic'), + help = locale('info.newsbmic'), }, function(source) if not checkReporterJob(source) then - TriggerClientEvent('ox_lib:notify', source, { description = Lang:t('error.no_access'), type = 'error' }) + TriggerClientEvent('ox_lib:notify', source, { description = locale('error.no_access'), type = 'error' }) return end TriggerClientEvent('qbx_newsjob:client:toggleBMic', source)