Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locale and translations #33

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions data/locale/en-US.ini
Original file line number Diff line number Diff line change
@@ -1 +1,39 @@
LocalVocalPlugin="LocalVocal Plugin"
transcription_filterAudioFilter="LocalVocal Transcription"
vad_enabled="VAD Enabled"
log_level="Log Level"
log_words="Log Output Words"
caption_to_stream="Stream Captions"
step_by_step_processing="Step-by-step processing (⚠️ processing will increase)"
step_size_msec="Step size (ms)"
subtitle_sources="Subtitles Output"
none_no_output="None / No output"
text_file_output="Text File output"
output_filename="Output filename"
whisper_model="Whisper Model"
external_model_file="External model file"
whisper_parameters="Whisper Parameters"
language="Language"
whisper_sampling_method="Whisper Sampling Method"
n_threads="Number of threads"
n_max_text_ctx="Max text context"
translate="Translate"
no_context="No context"
single_segment="Single segment"
print_special="Print special"
print_progress="Print progress"
print_realtime="Print realtime"
print_timestamps="Print timestamps"
token_timestamps="Token timestamps"
thold_pt="Token prob. threshold"
thold_ptsum="Token sum prob. threshold"
max_len="Max length in chars"
split_on_word="Split on word"
max_tokens="Max tokens"
speed_up="Speed up"
initial_prompt="Initial prompt"
suppress_blank="Suppress blank"
suppress_non_speech_tokens="Suppress non-speech tokens"
temperature="Temperature"
max_initial_ts="Max initial timestamps"
length_penalty="Length penalty"
40 changes: 40 additions & 0 deletions data/locale/pt_BR.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Portuguese (Brazil) translation
LocalVocalPlugin="Plugin LocalVocal"
transcription_filterAudioFilter="LocalVocal Transcrição"
vad_enabled="VAD Habilitado"
log_level="Nível de log"
log_words="Log Palavras"
caption_to_stream="Legendas de fluxo"
step_by_step_processing="Processamento passo a passo (⚠️ o processamento aumentará)"
step_size_msec="Tamanho do passo (ms)"
subtitle_sources="Legendas de saída"
none_no_output="Nenhum / Sem saída"
text_file_output="Saída do arquivo de texto"
output_filename="Nome do arquivo de saída"
whisper_model="Modelo Whisper"
external_model_file="Arquivo de modelo externo"
whisper_parameters="Parâmetros Whisper"
language="Língua"
whisper_sampling_method="Método de amostragem Whisper"
n_threads="Número de threads"
n_max_text_ctx="Máximo de contexto de texto"
translate="Traduzir"
no_context="Sem contexto"
single_segment="Segmento único"
print_special="Imprimir especial"
print_progress="Imprimir progresso"
print_realtime="Imprimir em tempo real"
print_timestamps="Imprimir carimbos de data"
token_timestamps="Carimbos de data"
thold_pt="Limiar token probabilidade"
thold_ptsum="Limiar token soma probabilidade"
max_len="Comprimento máximo em caracteres"
split_on_word="Dividir na palavra"
max_tokens="Máximo de tokens"
speed_up="Acelerar"
initial_prompt="Prompt inicial"
suppress_blank="Suprimir em branco"
suppress_non_speech_tokens="Suprimir tokens não fala"
temperature="Temperatura"
max_initial_ts="Tempo inicial máximo"
length_penalty="Pena de comprimento"
39 changes: 39 additions & 0 deletions data/locale/ru_RU.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
LocalVocalPlugin="Плагин LocalVocal"
transcription_filterAudioFilter="LocalVocal Транскрипция"
vad_enabled="VAD Включен"
log_level="Уровень логирования"
log_words="Логировать слова"
caption_to_stream="Потоковые субтитры"
step_by_step_processing="Пошаговая обработка (⚠️ обработка будет увеличена)"
step_size_msec="Размер шага (мс)"
subtitle_sources="Выходные субтитры"
none_no_output="Нет / Нет выхода"
text_file_output="Выходной текстовый файл"
output_filename="Имя выходного файла"
whisper_model="Whisper Модель"
external_model_file="Внешний файл модели"
whisper_parameters="Параметры Whisper"
language="Язык"
whisper_sampling_method="Метод выборки Whisper"
n_threads="Количество потоков"
n_max_text_ctx="Максимальный текстовый контекст"
translate="Перевести"
no_context="Нет контекста"
single_segment="Одиночный сегмент"
print_special="Печать специальных"
print_progress="Печать прогресса"
print_realtime="Печать в реальном времени"
print_timestamps="Печать временных меток"
token_timestamps="Временные метки токенов"
thold_pt="Порог вероятности токена"
thold_ptsum="Порог суммы вероятностей токена"
max_len="Максимальная длина в символах"
split_on_word="Разделить по слову"
max_tokens="Максимальное количество токенов"
speed_up="Ускорить"
initial_prompt="Начальный приглашение"
suppress_blank="Подавить пустое"
suppress_non_speech_tokens="Подавить токены, не относящиеся к речи"
temperature="Температура"
max_initial_ts="Максимальное начальное время"
length_penalty="Штраф за длину"
6 changes: 3 additions & 3 deletions src/plugin-main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Plugin Name
Copyright (C) <Year> <Developer> <Email Address>
obs-localvocal
Copyright (C) 2023 Roy Shilkrot [email protected]

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
Expand Down Expand Up @@ -32,7 +32,7 @@ extern struct obs_source_info transcription_filter_info;
bool obs_module_load(void)
{
obs_register_source(&transcription_filter_info);
blog(LOG_INFO, "plugin loaded successfully (version %s)", PLUGIN_VERSION);
obs_log(LOG_INFO, "plugin loaded successfully (version %s)", PLUGIN_VERSION);
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions src/plugin-support.c.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Plugin Name
Copyright (C) <Year> <Developer> <Email Address>
obs-localvocal
Copyright (C) 2023 Roy Shilkrot [email protected]

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
Expand Down
4 changes: 2 additions & 2 deletions src/plugin-support.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Plugin Name
Copyright (C) <Year> <Developer> <Email Address>
obs-localvocal
Copyright (C) 2023 Roy Shilkrot [email protected]

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
Expand Down
4 changes: 2 additions & 2 deletions src/transcription-filter-data.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ struct transcription_filter_data {

/* whisper */
char *whisper_model_path = nullptr;
std::string whisper_model_file_currently_loaded = "";
struct whisper_context *whisper_context = nullptr;
whisper_full_params whisper_params;

Expand All @@ -63,7 +62,8 @@ struct transcription_filter_data {
// Callback to set the text in the output text source (subtitles)
std::function<void(const std::string &str)> setTextCallback;
// Output file path to write the subtitles
std::string output_file_path;
std::string output_file_path = "";
std::string whisper_model_file_currently_loaded = "";

// Use std for thread and mutex
std::thread whisper_thread;
Expand Down
Loading