Skip to content

Commit

Permalink
UI: Convert ADS translation source texts
Browse files Browse the repository at this point in the history
  • Loading branch information
tytan652 committed Mar 25, 2022
1 parent 1c2e961 commit 5c9b1ff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions UI/data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ ShowOnStartup="Show on startup"
OpenFile="Open file"
AddValue="Add %1"

# ADS
CloseOthers="Close Others"
CloseTab="Close Tab"
CloseActiveTab="Close Active Tab"
ShowView="Show View"
DetachGroup="Detach Group"
CloseGroup="Close Group"
CloseOtherGroups="Close Other Groups"
ListAllTabs="List All Tabs"

# warning if program already open
AlreadyRunning.Title="OBS is already running"
AlreadyRunning.Text="OBS is already running! Unless you meant to do this, please shut down any existing instances of OBS before trying to run a new instance. If you have OBS set to minimize to the system tray, please check to see if it's still running there."
Expand Down
8 changes: 8 additions & 0 deletions UI/obs-app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1620,6 +1620,14 @@ QString OBSTranslator::translate(const char *context, const char *sourceText,
const char *disambiguation, int n) const
{
const char *out = nullptr;

/* Allow to convert ADS source text to translation keys
* by removing any spaces from it */
if (QT_UTF8(sourceText).contains(" ")) {
QString text(QT_UTF8(sourceText).remove(" "));
sourceText = strdup(QT_TO_UTF8(text));
}

if (!App()->TranslateString(sourceText, &out))
return QString(sourceText);

Expand Down

0 comments on commit 5c9b1ff

Please sign in to comment.