Last active
August 29, 2015 14:14
-
-
Save azatoth/7b0ab01f4b9500f3e9f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use v5.18; | |
use Config::General; | |
use File::Find::Wanted; | |
use File::Slurp; | |
use List::Compare; | |
use JSON; | |
my @source_dirs = qw( | |
obs | |
plugins/win-dshow | |
plugins/obs-libfdk | |
plugins/win-wasapi | |
plugins/text-freetype2 | |
plugins/linux-pulseaudio | |
plugins/obs-outputs | |
plugins/mac-syphon | |
plugins/linux-capture | |
plugins/image-source | |
plugins/mac-avcapture | |
plugins/rtmp-services | |
plugins/mac-capture | |
plugins/obs-x264 | |
plugins/obs-ffmpeg | |
plugins/linux-v4l2 | |
plugins/win-capture | |
); | |
my $res = {}; | |
foreach my $dir( @source_dirs ) { | |
my @src_files = find_wanted(sub { -f && /\.([ch]p*|mm|ui|qrc)$/ }, $dir); | |
my @translation_keys; | |
foreach my $srcfile(@src_files) { | |
my $text = read_file( $srcfile, binmode => ':utf8' ) ; | |
push @translation_keys, ($text =~ m/(?:QT)?Str\("(.*?)"\)/g); | |
push @translation_keys, ($text =~ m/<string>(.*?)<\/string>/g); | |
} | |
my %locale; | |
%locale = Config::General->new(-ConfigFile => "$dir/data/locale/en-US.ini", -UTF8 => 1)->getall; | |
my @locale_keys = keys %locale; | |
my $lc = List::Compare->new(\@translation_keys, \@locale_keys); | |
my @Lonly = $lc->get_Lonly; | |
my @Ronly = $lc->get_Ronly; | |
$res->{$dir} = { | |
source_only => \@Lonly, | |
locale_only => \@Ronly, | |
}; | |
} | |
say JSON->new->utf8(1)->pretty(1)->canonical(1)->encode($res); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"obs" : { | |
"locale_only" : [ | |
"Apply", | |
"Basic.AuxDevice4", | |
"Basic.MainMenu.Edit.RedoAction", | |
"Basic.MainMenu.Edit.UndoAction", | |
"Basic.PropertiesWindow.AutoSelectFormat", | |
"Basic.Settings.Output.Mode.Advanced", | |
"Basic.Settings.Video.DisableAeroWindows", | |
"Basic.Settings.Video.FPS", | |
"Basic.Settings.Video.InvalidResolution", | |
"Cancel", | |
"Language", | |
"OK", | |
"Region" | |
], | |
"source_only" : [ | |
".MainWindow", | |
"128", | |
"160", | |
"192", | |
"22.05khz", | |
"256", | |
"32", | |
"320", | |
"44.1khz", | |
"48khz", | |
"64", | |
"96", | |
"AuxAudioDevice1", | |
"AuxAudioDevice2", | |
"AuxAudioDevice3", | |
"Basic.Main.MoveDown", | |
"Basic.Main.MoveUp", | |
"Basic.MainMenu.SwitchMode", | |
"Basic.Settings.Output.Mode.Custom", | |
"Ctrl+C", | |
"Ctrl+Down", | |
"Ctrl+End", | |
"Ctrl+F", | |
"Ctrl+Home", | |
"Ctrl+R", | |
"Ctrl+S", | |
"Ctrl+Up", | |
"Del", | |
"DesktopAudioDevice1", | |
"DesktopAudioDevice2", | |
"Dialog", | |
"Disabled", | |
"Interact", | |
"OpenDirectory" | |
] | |
}, | |
"plugins/image-source" : { | |
"locale_only" : [ | |
"File", | |
"ImageInput" | |
], | |
"source_only" : [] | |
}, | |
"plugins/linux-capture" : { | |
"locale_only" : [ | |
"AdvancedSettings", | |
"CaptureCursor", | |
"CropBottom", | |
"CropLeft", | |
"CropRight", | |
"CropTop", | |
"IncludeXBorder", | |
"LockX", | |
"Screen", | |
"SwapRedBlue", | |
"Window", | |
"X11SharedMemoryScreenInput", | |
"XCCapture", | |
"XServer" | |
], | |
"source_only" : [] | |
}, | |
"plugins/linux-pulseaudio" : { | |
"locale_only" : [ | |
"Device", | |
"PulseInput", | |
"PulseOutput" | |
], | |
"source_only" : [] | |
}, | |
"plugins/linux-v4l2" : { | |
"locale_only" : [ | |
"Device", | |
"FrameRate", | |
"ImageFormat", | |
"Input", | |
"LeaveUnchanged", | |
"Resolution", | |
"UseSystemTiming", | |
"V4L2Input" | |
], | |
"source_only" : [] | |
}, | |
"plugins/mac-avcapture" : { | |
"locale_only" : [ | |
"AVCapture", | |
"Device", | |
"Preset", | |
"UsePreset" | |
], | |
"source_only" : [] | |
}, | |
"plugins/mac-capture" : { | |
"locale_only" : [ | |
"CoreAudio.Device", | |
"CoreAudio.Device.Default", | |
"CoreAudio.InputCapture", | |
"CoreAudio.OutputCapture", | |
"Crop.origin.x", | |
"Crop.origin.y", | |
"Crop.size.height", | |
"Crop.size.width", | |
"CropMode", | |
"CropMode.Manual", | |
"CropMode.None", | |
"CropMode.ToWindow", | |
"CropMode.ToWindowAndManual", | |
"DisplayCapture", | |
"DisplayCapture.Display", | |
"DisplayCapture.ShowCursor", | |
"WindowCapture", | |
"WindowCapture.ShowShadow", | |
"WindowUtils.ShowEmptyNames", | |
"WindowUtils.Window" | |
], | |
"source_only" : [] | |
}, | |
"plugins/mac-syphon" : { | |
"locale_only" : [ | |
"AllowTransparency", | |
"Application", | |
"Crop", | |
"Crop.origin.x", | |
"Crop.origin.y", | |
"Crop.size.height", | |
"Crop.size.width", | |
"Inject", | |
"LaunchSyphonInject", | |
"Source", | |
"SyphonLicense" | |
], | |
"source_only" : [] | |
}, | |
"plugins/obs-ffmpeg" : { | |
"locale_only" : [ | |
"Bitrate", | |
"FFmpegAAC", | |
"FFmpegOutput" | |
], | |
"source_only" : [] | |
}, | |
"plugins/obs-libfdk" : { | |
"locale_only" : [ | |
"Afterburner", | |
"Bitrate", | |
"LibFDK" | |
], | |
"source_only" : [] | |
}, | |
"plugins/obs-outputs" : { | |
"locale_only" : [ | |
"FLVOutput", | |
"FLVOutput.FilePath", | |
"RTMPStream", | |
"RTMPStream.DropThreshold" | |
], | |
"source_only" : [] | |
}, | |
"plugins/obs-x264" : { | |
"locale_only" : [ | |
"Bitrate", | |
"BufferSize", | |
"CPUPreset", | |
"EncoderOptions", | |
"KeyframeIntervalSec", | |
"Profile", | |
"Tune" | |
], | |
"source_only" : [] | |
}, | |
"plugins/rtmp-services" : { | |
"locale_only" : [ | |
"CustomStreamingServer", | |
"Server", | |
"Service", | |
"StreamKey", | |
"StreamingServices" | |
], | |
"source_only" : [] | |
}, | |
"plugins/text-freetype2" : { | |
"locale_only" : [ | |
"ChatLogMode", | |
"Color1", | |
"Color2", | |
"CustomWidth", | |
"DropShadow", | |
"Font", | |
"Outline", | |
"ReadFromFile", | |
"Text", | |
"TextFile", | |
"TextFileFilter", | |
"WordWrap" | |
], | |
"source_only" : [] | |
}, | |
"plugins/win-capture" : { | |
"locale_only" : [ | |
"AllowTransparency", | |
"CaptureCursor", | |
"Compatibility", | |
"GameCapture", | |
"GameCapture.AnyFullscreen", | |
"GameCapture.CaptureOverlays", | |
"GameCapture.ForceScaling", | |
"GameCapture.LimitFramerate", | |
"GameCapture.ScaleRes", | |
"Monitor", | |
"MonitorCapture", | |
"PrimaryMonitor", | |
"WindowCapture", | |
"WindowCapture.Priority", | |
"WindowCapture.Priority.Class", | |
"WindowCapture.Priority.Exe", | |
"WindowCapture.Priority.Title", | |
"WindowCapture.Window" | |
], | |
"source_only" : [] | |
}, | |
"plugins/win-dshow" : { | |
"locale_only" : [ | |
"Activate", | |
"AudioDevice", | |
"Bitrate", | |
"Buffering", | |
"Buffering.AutoDetect", | |
"Buffering.Disable", | |
"Buffering.Enable", | |
"ConfigureAudio", | |
"ConfigureCrossbar", | |
"ConfigureVideo", | |
"Deactivate", | |
"Device", | |
"Encoder.C353", | |
"Encoder.C985", | |
"FPS.Highest", | |
"FPS.Matching", | |
"ResFPSType", | |
"ResFPSType.Custom", | |
"ResFPSType.DevPreferred", | |
"Resolution", | |
"UseCustomAudioDevice", | |
"VideoCaptureDevice", | |
"VideoFormat", | |
"VideoFormat.Any", | |
"VideoFormat.Unknown" | |
], | |
"source_only" : [] | |
}, | |
"plugins/win-wasapi" : { | |
"locale_only" : [ | |
"AudioInput", | |
"AudioOutput", | |
"Default", | |
"Device", | |
"UseDeviceTiming" | |
], | |
"source_only" : [] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment