diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 37f4d68eb..104e71196 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -81,4 +81,5 @@ fix lint error: unused argument last; accessing undefined variable Invoke; unuse 54. [bpt_ballasjob]: Fixed the problem that prevented the creation of invoices @bitpredator 55. [bpt_crafting]: Refactor: created support for translations natively through local files @bitpredator 56. [bpt_deliveries]: feat + chore: updated readme file + creation of Italian translation @bitpredator -57. [bpt_dustman]: refactor: bpt_dustman inventory implementation @bitpredator \ No newline at end of file +57. [bpt_dustman]: refactor: bpt_dustman inventory implementation @bitpredator +58. [bpt_farmer]: refactor: support for translations through local files @bitpredator \ No newline at end of file diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/README.md b/server-data/resources/[bpt_addons]/bpt_farmer/README.md index 70e2a899d..ee747e597 100644 --- a/server-data/resources/[bpt_addons]/bpt_farmer/README.md +++ b/server-data/resources/[bpt_addons]/bpt_farmer/README.md @@ -1,11 +1,14 @@ -# bpt_farmer +

bpt_farmer

+

Discord Copyright (C) 2022-2023 bitpredator -This program is a project for the fivem community, you have legal permission to distribute and / or modify it only if you have forked this repository, if it is not a fork repository, the version will be removed from the DMCA request. +This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version. + +This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details. ATTENTION: -You are not authorized to change the name of the resource. +You are not authorized to change the name of the resource and the resources within it. If you want to contribute you can open a pull request. @@ -13,4 +16,4 @@ You are not authorized to sell this software (this is free project). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. +You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. \ No newline at end of file diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/client/main.lua b/server-data/resources/[bpt_addons]/bpt_farmer/client/main.lua index 6f487c894..d68d86b51 100644 --- a/server-data/resources/[bpt_addons]/bpt_farmer/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_farmer/client/main.lua @@ -10,7 +10,7 @@ local Keys = { ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 } -local incollect = false +local incollect = false ESX = exports["es_extended"]:getSharedObject() RegisterNetEvent('esx:playerLoaded') @@ -42,7 +42,7 @@ CreateThread(function() Wait(0) local coords = GetEntityCoords(PlayerPedId()) if (GetDistanceBetweenCoords(coords, 2233.21, 5081.3, 48.08, true) < 10.0) then - DrawText3D(2233.21, 5081.3, 48.08, 'Premi ~b~[E] per raccogliere delle patate', 0.4) + DrawText3D(2233.21, 5081.3, 48.08, _U('press_collect'), 0.4) if ESX.GetPlayerData().job.name then if (GetDistanceBetweenCoords(coords, 2233.21, 5081.3, 48.08, true) < 5.0) then if IsControlJustReleased(0, Keys['E']) then @@ -62,7 +62,7 @@ CreateThread(function() Wait(0) local coords = GetEntityCoords(PlayerPedId()) if (GetDistanceBetweenCoords(coords, 1582.035156, 2167.279053, 79.307007, true) < 10.0) then - DrawText3D(1582.035156, 2167.279053, 79.307007, 'Premi ~b~[E] per raccogliere del cotone', 0.4) + DrawText3D(1582.035156, 2167.279053, 79.307007, _U('press_collect'), 0.4) if ESX.GetPlayerData().job.name then if (GetDistanceBetweenCoords(coords, 1582.035156, 2167.279053, 79.307007, true) < 5.0) then if IsControlJustReleased(0, Keys['E']) then @@ -82,7 +82,7 @@ CreateThread(function() Wait(0) local coords = GetEntityCoords(PlayerPedId()) if (GetDistanceBetweenCoords(coords, 2343.850586, 4756.087891, 34.806641, true) < 10.0) then - DrawText3D(2343.850586, 4756.087891, 34.806641, 'Premi ~b~[E] per raccogliere delle mele', 0.4) + DrawText3D(2343.850586, 4756.087891, 34.806641, _U('press_collect'), 0.4) if ESX.GetPlayerData().job.name then if (GetDistanceBetweenCoords(coords, 2343.850586, 4756.087891, 34.806641, true) < 5.0) then if IsControlJustReleased(0, Keys['E']) then @@ -102,7 +102,7 @@ CreateThread(function() Wait(0) local coords = GetEntityCoords(PlayerPedId()) if (GetDistanceBetweenCoords(coords, 2607.942871, 4399.490234, 40.973633, true) < 10.0) then - DrawText3D(2607.942871, 4399.490234, 40.973633, 'Premi ~b~[E] per raccogliere il grano', 0.4) + DrawText3D(2607.942871, 4399.490234, 40.973633, _U('press_collect'), 0.4) if ESX.GetPlayerData().job.name then if (GetDistanceBetweenCoords(coords, 2607.942871, 4399.490234, 40.973633, true) < 5.0) then if IsControlJustReleased(0, Keys['E']) then @@ -118,10 +118,10 @@ end) local blips = { - {title="Raccolta patate", colour=0, id=398, x = 2233.21, y = 5081.3, z = 48.08}, - {title="Raccolta cotone", colour=0, id=398, x = 1582.035156, y = 2167.279053, z = 79.307007}, - {title="Raccolta mele", colour=0, id=398, x = 2343.850586, y = 4756.087891, z = 34.806641}, - {title="Raccolta grano", colour=0, id=398, x = 2607.942871, y = 4399.490234, z = 40.973633} + {title="Potato harvest", colour=0, id=398, x = 2233.21, y = 5081.3, z = 48.08}, + {title="Cotton harvesting", colour=0, id=398, x = 1582.035156, y = 2167.279053, z = 79.307007}, + {title="Apple picking", colour=0, id=398, x = 2343.850586, y = 4756.087891, z = 34.806641}, + {title="Wheat harvest", colour=0, id=398, x = 2607.942871, y = 4399.490234, z = 40.973633} } CreateThread(function() @@ -136,13 +136,12 @@ CreateThread(function() AddTextComponentString(info.title) EndTextCommandSetBlipName(info.blip) end - end) --potato function collectionpotato() TriggerServerEvent('farmer:collectionpotato') - exports["esx_notify"]:Notify("info", 3000, "Raccolta patate in corso") + exports["esx_notify"]:Notify("info", 3000, _U('collection_progress')) incollect = true Wait(6000) incollect = false @@ -151,7 +150,7 @@ end -- cotton function collectioncotton() TriggerServerEvent('farmer:collectioncotton') - exports["esx_notify"]:Notify("info", 3000, "Raccolta cotone in corso") + exports["esx_notify"]:Notify("info", 3000, _U('collection_progress')) incollect = true Wait(6000) incollect = false @@ -160,7 +159,7 @@ end -- apple function collectionapple() TriggerServerEvent('farmer:collectionapple') - exports["esx_notify"]:Notify("info", 3000, "Raccolta mele in corso") + exports["esx_notify"]:Notify("info", 3000, _U('collection_progress')) incollect = true Wait(6000) incollect = false @@ -169,7 +168,7 @@ end -- grain function collectiongrain() TriggerServerEvent('farmer:collectiongrain') - exports["esx_notify"]:Notify("info", 3000, "Raccolta grano in corso") + exports["esx_notify"]:Notify("info", 3000, _U('collection_progress')) incollect = true Wait(6000) incollect = false diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/config.lua b/server-data/resources/[bpt_addons]/bpt_farmer/config.lua new file mode 100644 index 000000000..78ca21f1d --- /dev/null +++ b/server-data/resources/[bpt_addons]/bpt_farmer/config.lua @@ -0,0 +1,2 @@ +Config = {} +Config.Locale = 'en' \ No newline at end of file diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/fxmanifest.lua b/server-data/resources/[bpt_addons]/bpt_farmer/fxmanifest.lua index 552beb387..74dc4b5ef 100644 --- a/server-data/resources/[bpt_addons]/bpt_farmer/fxmanifest.lua +++ b/server-data/resources/[bpt_addons]/bpt_farmer/fxmanifest.lua @@ -1,19 +1,22 @@ fx_version 'adamant' game 'gta5' description 'bpt_farmer, introduces various collection points for the crafting system (not a job)' -author'bitpredator' -version'1.0.0' +author 'bitpredator' +version '1.0.0' shared_script '@es_extended/imports.lua' client_script { '@es_extended/locale.lua', - 'client/main.lua', - 'client/animated.lua' + 'client/*.lua', + 'locales/*.lua', + 'config.lua', } server_scripts { '@es_extended/locale.lua', - 'server/main.lua', - '@oxmysql/lib/MySQL.lua' + 'server/*.lua', + '@oxmysql/lib/MySQL.lua', + 'locales/*.lua', + 'config.lua', } \ No newline at end of file diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/locales/en.lua b/server-data/resources/[bpt_addons]/bpt_farmer/locales/en.lua new file mode 100644 index 000000000..288334ec1 --- /dev/null +++ b/server-data/resources/[bpt_addons]/bpt_farmer/locales/en.lua @@ -0,0 +1,4 @@ +Locales['en'] = { + ['press_collect'] = 'Press ~b~[E] to collect', + ['collection_progress'] = 'Collection in progress' +} \ No newline at end of file diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/locales/it.lua b/server-data/resources/[bpt_addons]/bpt_farmer/locales/it.lua new file mode 100644 index 000000000..6d2ed296a --- /dev/null +++ b/server-data/resources/[bpt_addons]/bpt_farmer/locales/it.lua @@ -0,0 +1,4 @@ +Locales['en'] = { + ['press_collect'] = 'Premi ~b~[E] per raccogliere', + ['collection_progress'] = 'Raccolta in corso' +} \ No newline at end of file