Support Chinese language
This commit is contained in:
10
README.md
10
README.md
@@ -6,14 +6,12 @@
|
||||
🎞 mpv.net
|
||||
==========
|
||||
|
||||
mpv.net is a media player for Windows based on the [mpv](https://mpv.io) player.
|
||||
mpv.net is a media player for Windows that has a modern GUI.
|
||||
|
||||
The player is based on the popular [mpv](https://mpv.io) media player.
|
||||
mpv.net is designed to be mpv compatible, almost all mpv features are available,
|
||||
this means the official [mpv manual](https://mpv.io/manual/master/) applies to mpv.net.
|
||||
|
||||
mpv focuses on the usage of the command line and the terminal,
|
||||
mpv.net retains the ability to be used from the command line and
|
||||
the terminal and adds a modern Windows GUI on top of it.
|
||||
this means the official [mpv manual](https://mpv.io/manual/master/) applies to mpv.net,
|
||||
differences are documented in the [mpv.net manual](docs/manual.md#differences-compared-to-mpv).
|
||||
|
||||
#### Graphical User Interface
|
||||
|
||||
|
||||
@@ -31,15 +31,12 @@ Table of contents
|
||||
About
|
||||
-----
|
||||
|
||||
mpv.net is a modern desktop media player for Windows based on the popular mpv player.
|
||||
mpv.net is a media player for Windows that has a modern GUI.
|
||||
|
||||
mpv.net is designed to be mpv compatible, almost all mpv features are available
|
||||
because they are all contained in libmpv, this means the official
|
||||
[mpv manual](https://mpv.io/manual/master/) applies to mpv.net.
|
||||
|
||||
mpv focuses on the usage of the command line and the terminal,
|
||||
mpv.net retains the ability to be used from the command line and
|
||||
the terminal and adds a modern Windows GUI on top of it.
|
||||
The player is based on the popular [mpv](https://mpv.io) media player.
|
||||
mpv.net is designed to be mpv compatible, almost all mpv features are available,
|
||||
this means the official [mpv manual](https://mpv.io/manual/master/) applies to mpv.net,
|
||||
differences are documented in this manual under [Differences compared to mpv](#differences-compared-to-mpv).
|
||||
|
||||
|
||||
Download
|
||||
@@ -565,8 +562,12 @@ In fullscreen mode clicking the top right corner closes the player.
|
||||
Differences compared to mpv
|
||||
---------------------------
|
||||
|
||||
mpv.net is designed to work exactly like mpv, there are a few limitations:
|
||||
mpv.net is designed to work exactly like mpv, there are a few
|
||||
differences and limitations:
|
||||
|
||||
The settings folder is named `mpv.net` instead of `mpv`:
|
||||
|
||||
`C:\Users\username\AppData\Roaming\mpv.net`
|
||||
|
||||
### Window Limitations
|
||||
|
||||
|
||||
@@ -102,7 +102,6 @@ D:\Projects\CS\mpv.net\src\NGettext.Wpf\GettextExtension.cs
|
||||
D:\Projects\CS\mpv.net\src\NGettext.Wpf\GettextFormatConverterExtension.cs
|
||||
D:\Projects\CS\mpv.net\src\NGettext.Wpf\IWeakCultureObserver.cs
|
||||
D:\Projects\CS\mpv.net\src\NGettext.Wpf\Localizer.cs
|
||||
D:\Projects\CS\mpv.net\src\NGettext.Wpf\NGettextWpfDependencyResolver.cs
|
||||
D:\Projects\CS\mpv.net\src\NGettext.Wpf\TrackCurrentCultureBehavior.cs
|
||||
D:\Projects\CS\mpv.net\src\NGettext.Wpf\Translation.cs
|
||||
D:\Projects\CS\mpv.net\src\NGettext.Wpf\Common\GettextStringFormatConverter.cs
|
||||
|
||||
1245
lang/po/de.po
1245
lang/po/de.po
File diff suppressed because it is too large
Load Diff
1247
lang/po/zh_CN.po
1247
lang/po/zh_CN.po
File diff suppressed because it is too large
Load Diff
1166
lang/source.pot
1166
lang/source.pot
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
|
||||
# # Extract msgids from xaml files in project into pot file.
|
||||
# . $PSScriptRoot/XGetText-Xaml.ps1
|
||||
# $xamlFiles = Get-ChildItem -Recurse -File -Filter *.xaml |
|
||||
# Where { $_.FullName -NotLike '*\obj\*' } | ForEach-Object { $_.FullName }
|
||||
# XGetText-Xaml -o obj/xamlmessages.pot -k Gettext,GettextFormatConverter $xamlFiles
|
||||
|
||||
|
||||
# # Merge two pot files into one
|
||||
# msgcat.exe --use-first -o obj/result.pot obj/source.pot obj/xamlmessages.pot
|
||||
|
||||
|
||||
# $Header = @"
|
||||
# # Translation of mpv.net to ???
|
||||
# # Copyright (C) 2023 Frank Skare (stax76) <frank.skare.de@gmail.com>
|
||||
# # Copyright (C) 2023 ???
|
||||
# # This file is distributed under the same license as the mpv.net package.
|
||||
# msgid ""
|
||||
# msgstr ""
|
||||
# "Project-Id-Version: mpv.net\n"
|
||||
# "Report-Msgid-Bugs-To: Frank Skare (stax76) <frank.skare.de@gmail.com>\n"
|
||||
# "POT-Creation-Date: 2023-11-04 16:50+0100\n"
|
||||
# "PO-Revision-Date: 2023-11-04 16:54+0100\n"
|
||||
# "Last-Translator: ???\n"
|
||||
# "Language-Team: ???\n"
|
||||
# "Language: ???\n"
|
||||
# "MIME-Version: 1.0\n"
|
||||
# "Content-Type: text/plain; charset=UTF-8\n"
|
||||
# "Content-Transfer-Encoding: 8bit\n"
|
||||
# "Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
# "@
|
||||
|
||||
# $Locales = @('bg', 'ca', 'cs', 'de', 'es', 'eu', 'fr', 'it', 'ja', 'ko', 'lt', 'nl', 'pl', 'pt', 'pt_BR', 'ro', 'ru', 'sr_RS', 'sr_RS@latin', 'sv', 'tr', 'uk', 'zh_CN', 'zh_SG', 'zh_TW')
|
||||
# $Locales | foreach { $Header -replace '"Language: \?\?\?\\n"', "`"Language: $($_)\n`"" |
|
||||
# Out-File $PSScriptRoot\PO\$_.po }
|
||||
@@ -1,73 +0,0 @@
|
||||
|
||||
function XGetText-Xaml {
|
||||
param(
|
||||
[Parameter(Mandatory=$true,
|
||||
Position=0,
|
||||
ParameterSetName="sourceFiles",
|
||||
HelpMessage="XAML files to extract msgids from.")]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string[]]$sourceFiles,
|
||||
[Parameter(Mandatory=$true,
|
||||
HelpMessage="Additional keywords that match MarkupExtensions enclosing msgids to be extracted.")]
|
||||
[Alias("k")]
|
||||
[string[]]
|
||||
$Keywords,
|
||||
[Parameter(Mandatory=$false,
|
||||
HelpMessage="Write output to specified file.")]
|
||||
[Alias("o")]
|
||||
[string]$output="messages.pot")
|
||||
|
||||
$extractedIds = New-Object -TypeName System.Collections.Hashtable
|
||||
|
||||
ForEach ($keyword in $Keywords)
|
||||
{
|
||||
ForEach ($sourceFile in $sourceFiles)
|
||||
{
|
||||
Select-String $sourceFile -Pattern $("{[a-z]?[a-z0-9]*:"+$keyword+ " (([^}{]|{[^}]*})*)}") -AllMatches | ForEach-Object {
|
||||
$filename = $sourceFile
|
||||
$lineNumber = $_.LineNumber
|
||||
$_.Matches | ForEach-Object {
|
||||
$msgid = $_.Groups[1].ToString()
|
||||
|
||||
if ($msgid.StartsWith("'") -and $msgid.EndsWith("'")){
|
||||
$msgid = $msgid.Substring(1, $msgid.Length-2);
|
||||
}
|
||||
|
||||
$msgid = $msgid.Replace("\'", "'")
|
||||
$msgid = $msgid.Replace("\,", ",")
|
||||
|
||||
if (-Not $extractedIds.ContainsKey($msgid))
|
||||
{
|
||||
$extractedIds.Add($msgid, @{Locations = New-Object System.Collections.ArrayList})
|
||||
}
|
||||
[void] $extractedIds[$msgid].Locations.Add('#: ' + $Filename + ':' + $LineNumber)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$result = '#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"POT-Creation-Date: ' + $(Get-Date -Format 'yyyy-mm-dd HH:mmK') + '\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n\n"' + [System.Environment]::NewLine + [System.Environment]::NewLine
|
||||
$extractedIds.GetEnumerator() | ForEach-Object {
|
||||
if ($_.Key -like '*|*' ) {
|
||||
$msgid = $_.Key.Substring($_.Key.indexof("|") +1)
|
||||
$msgctxt = $_.Key.Substring(0, $_.Key.indexof("|"))
|
||||
|
||||
$result = $result + $($_.Value.Locations -join [System.Environment]::NewLine) + [System.Environment]::NewLine + "msgctxt """ + $msgctxt + """" + [System.Environment]::NewLine + "msgid """ + $msgid + """" + [System.Environment]::NewLine + "msgstr """"" + [System.Environment]::NewLine + [System.Environment]::NewLine + [System.Environment]::NewLine
|
||||
}
|
||||
else {
|
||||
$result = $result + $($_.Value.Locations -join [System.Environment]::NewLine) + [System.Environment]::NewLine + "msgid """ + $_.Key + """" + [System.Environment]::NewLine + "msgstr """"" + [System.Environment]::NewLine + [System.Environment]::NewLine + [System.Environment]::NewLine
|
||||
}
|
||||
}
|
||||
|
||||
if ($output -eq '-') {
|
||||
Write-Output $result.ToString()
|
||||
} else {
|
||||
[System.IO.File]::WriteAllLines($ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($output), ($result -replace "\r", ""))
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ public class WpfTranslator : ITranslator
|
||||
{
|
||||
static Language[] Languages { get; } = new Language[] {
|
||||
new("english", "en", "en"),
|
||||
new("chinese-china", "zh-Hans", "zh"), // Chinese (Simplified)
|
||||
new("chinese-china", "zh-CN", "zh"), // Chinese (Simplified)
|
||||
new("german", "de", "de"),
|
||||
};
|
||||
|
||||
@@ -44,7 +44,7 @@ public class WpfTranslator : ITranslator
|
||||
if (lang.MpvNetName == name)
|
||||
return new CultureInfo(lang.CultureInfoName);
|
||||
|
||||
throw new Exception($"Unknown language {name}.");
|
||||
return new CultureInfo("en");
|
||||
}
|
||||
|
||||
class Language
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace NGettext.Wpf.Common
|
||||
|
||||
public GettextStringFormatConverter(string msgId)
|
||||
{
|
||||
this.MsgId = msgId;
|
||||
MsgId = msgId;
|
||||
}
|
||||
|
||||
public static ILocalizer Localizer { get; set; }
|
||||
@@ -25,4 +25,4 @@ namespace NGettext.Wpf.Common
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
|
||||
using System.Globalization;
|
||||
|
||||
namespace NGettext.Wpf
|
||||
@@ -13,4 +13,4 @@ namespace NGettext.Wpf
|
||||
|
||||
public CultureInfo CultureInfo { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
namespace NGettext.Wpf.EnumTranslation
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
|
||||
|
||||
namespace NGettext.Wpf.EnumTranslation
|
||||
{
|
||||
public class EnumMsgIdAttribute : Attribute
|
||||
@@ -11,4 +10,4 @@ namespace NGettext.Wpf.EnumTranslation
|
||||
|
||||
public string MsgId { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
|
||||
Reference in New Issue
Block a user