NOALBS / nginx-obs-automatic-low-bitrate-switching

Simple app to automatically switch scenes in OBS based on the current bitrate fetched from the NGINX stats page.
http://noalbs.com
MIT License
340 stars 77 forks source link

language issue #101

Closed FkManu closed 2 years ago

FkManu commented 2 years ago

I tried to create a file for the Italian language since it has not been added yet, with customized answers based on the streamer the bot will go to, but every time I try to change the language with the new file the bot responds who does not find it

this is the file I created and called it.yml (it's half translated because I was doing some tests)

it:
    start:
        success: PagMan Live On 
        error: "Non sono riuscito ad avviare la stream FeelsBadMan : %{error}"
    startTwitchTranscoding:
        trying: Trying to start the stream with transcoding
        successNoTranscoding: Successfully started the stream without transcoding
        success: Started stream with transcoding %{attemptsMessage}
        attempts: ", took %{count} attempts"
    stop:
        success: Stream finita PepeHands 
        error: "Error can't stop the stream: %{error}"
    switch:
        noParams: Si ma dimmi la scena homyGa
        success: Sto cambiando la scena homyTurkey "%{scene}"
        error: Non riesco a cambiare alla scena selezionata FeelsBadMan "%{scene}"
    bitrate:
        success: "%{name}: %{message}"
        error: "Nessuna connessione FeelsLagMan"
    trigger:
        success: Soglia di cambio scena cambiata a %{number} Kbps DankG
        successDisabled: Soglia cambio scena disattivata DankG
        error: Error editing trigger %{number} is not a valid value
        current: La soglia di cambio scena e' %{number} Kbps Okayge
        disabled: La soglia di cambio scena e' disabilitata Okayge
    sourceinfo:
        noInfo: No information
        notFound: "Error no server found with the name: %{name}"
    rec:
        started: Recording started
        stopped: Recording stopped
        errorStatus: Error getting recording status
        errorToggle: Error toggling recording
    fix:
        try: Sto cercando di aggiustare questa merda, un attimo DonkChat
        error: Non riesco a fixare la stream FeelsBadMan
    refresh:
        try: Sto refreshando la stream docSpin
        error: Il refresh non e' andato a buon fine FeelsBadMan
        success: Refresh eseguito con successo YEPP
        noScene: Nessuna scena impostata per il refresh, prova ad utilizzare !fix Okayge
    alias:
        success: Added alias %{alias} -> %{command}
        removed: Alias %{alias} removed
        errorCommand: Command %{command} doesn't exist
        errorAlias: Alias %{alias} doesn't exist
        errorAlreadyUsed: "%{alias} already used as alias"
        errorIncorrectArguments: Error incorrect arguments given
    sceneSwitch:
        switch: Scene switched to "%{scene}"
    offlineTimeout:
        timeout: Offline timeout reached, stopping the stream
    handleCommands:
        public: Public commands %{condition}
        mod: Mod commands %{condition}
        notify: Auto switch notification %{condition}
        autostop: Auto stop stream %{condition}
        enabled: is enabled
        disabled: is disabled
    noalbs:
        prefix: NOALBS prefix updated to %{prefix}
        errorPrefix: Can't update NOALBS prefix
        switcherEnabled: Successfully enabled the switcher
        switcherDisabled: Successfully disabled the switcher
        instantSwitch: Instant switch on recover %{condition}
        langError: Can't update NOALBS language
        langErrorInvalid: Error editing language %{lang} is not a valid value
        langSuccess: NOALBS language updated to %{lang}
        retryCount: Current retry set at %{count}
        retryError: Error editing retry attempts %{count} is not a valid value
        retrySuccess: Retry attempts set to %{count}
    scene:
        success: Sto cambiando la scena su %{scene} homyChatting
        error: Non esiste %{scene} nelle scene, controlla di aver scritto correttamente homyTurkey

output:

image

I don't know if I'm wrong but the procedure should be quite simple from what I know you only need to change from "en" to the desired language.

DigibitDK commented 2 years ago

Works for me in v2 with dk:

2022-06-02 22_51_47-Window

Might have something to do with Noalbs not knowing that IT exists. In v1 it was possible to create any custom lang-file, but not sure its the same in v2. You can try edit dk-lang file and see if it works. Then you can test until its done and then create a pull-request.

FkManu commented 2 years ago

Works for me in v2 with dk:

2022-06-02 22_51_47-Window

Might have something to do with Noalbs not knowing that IT exists. In v1 it was possible to create any custom lang-file, but not sure its the same in v2. You can try edit dk-lang file and see if it works. Then you can test until its done and then create a pull-request.

I tried to directly modify the dk.yml file with the response of the scene change in Italian, but the result is that the changes are as if they were not counted, as if the languages ​​were preloaded and not taken from the locales folder

dk:
    start:
        success: stream incominciata !
        error: "Fejl: %{error}"
    startTwitchTranscoding:
        trying: Trying to start the stream with transcoding
        successNoTranscoding: Successfully started the stream without transcoding
        success: Started stream with transcoding %{attemptsMessage}
        attempts: ", took %{count} attempts"
    stop:
        success: stream finita!
        error: "Error can't stop the stream: %{error}"
    switch:
        noParams: Ingen scene angivet
        success: scena cambiata correttamente "%{scene}"
        error: "Fejl: {scene}"

output: image

DigibitDK commented 2 years ago

Did you restart the bot after the changes?

(Make sure that the files you edit, is really the files that noalbs is using depending on your setup and installation)

I need to test a bit more if its still an issue.

FkManu commented 2 years ago

Did you restart the bot after the changes?

(Make sure that the files you edit, is really the files that noalbs is using depending on your setup and installation)

I need to test a bit more if its still an issue.

certainly I restarted and changed only this inside the locales folder, I also noticed that initially the line ''language'' in the config.json file was initially at the bottom with lowercase formatting, after doing the command in chat move the line bottom to top reformatting it From this (last line of code):

  "optionalOptions": {
    "twitchTranscodingCheck": false,
    "twitchTranscodingRetries": 5,
    "twitchTranscodingDelaySeconds": 15,
    "offlineTimeout": null
  },
  "language": "en"
}

to this (103rd line of code) :

    "language": "DK",
    "prefix": "!",
    "enablePublicCommands": false,
    "enableModCommands": true,
    "enableAutoStopStreamOnHostOrRaid": true,
    "commands": {
      "Fix": {
        "permission": "Mod",
        "alias": [
          "f"
        ]
FkManu commented 2 years ago

ok, I also read from another thread that it is necessary to make a pull request with the translated file in the desired language in order for it to be added. At this point my question is: to put a customized language file locally is it necessary to re-download v1 and do everything with that version?

715209 commented 2 years ago

Hi @FkManu ,

The language files are compiled into the binary, so to use a custom language file you will have to compile NOALBS yourself.

If you're adding a language that doesn't exist, it needs to be added in here: https://github.com/715209/nginx-obs-automatic-low-bitrate-switching/blob/c590e1ee47cd2d8ffa8bf11b64f40ddd14b2222f/src/chat/mod.rs#L99-L147

FkManu commented 2 years ago

Hi @FkManu ,

The language files are compiled into the binary, so to use a custom language file you will have to compile NOALBS yourself.

If you're adding a language that doesn't exist, it needs to be added in here:

https://github.com/715209/nginx-obs-automatic-low-bitrate-switching/blob/c590e1ee47cd2d8ffa8bf11b64f40ddd14b2222f/src/chat/mod.rs#L99-L147

thank you very much for your help, after a few attempts I managed to install everything necessary to compile noalbs by myself and I saw that you have also promptly updated to the Italian language, I can also consider the thread solved.