Comments (25)
Translation support is now functional for the client, you can find the default strings file in https://github.com/exelix11/SysDVR/blob/translation-support/Client/Platform/Resources/resources/strings/english.json
You can submit a pull request to the translation-support branch or just provide your translated file here or on discord.
To test your translations you can get a build from github actions https://github.com/exelix11/SysDVR/actions/runs/7586908510 and add your custom json file in Resources\strings
Let me know if any issue pops up., in the meantime i'll look into adding translation support to the console settings app as well.
from sysdvr.
Starting with 6.0 the new GUI also builds for mac, linux and android making Windows projects specific stuff like resx either unapplicable or a pain to use which is why i was proposing jsons. Android in particular is a very annoying platform to support properly.
Most notably we lose winforms magic font support that just works and have to manually manage fonts and character ranges. This is the reason why localization didn't make it into the 6.0 release.
from sysdvr.
Good job bro! I can provide translation contributions in Simplified Chinese(zh-CN) and Traditional Chinese(zh-TW)~
from sysdvr.
Very good idea, my team on discord would be ready to work for the French part ^^
from sysdvr.
cc @spreedated who worked on translations in #253
from sysdvr.
My fork is still up and running.
Technically you have some choices to provide localization. Via JSON is only one, another common is an INI File or XML, actually any Textfile will do.
I used the built-in Microsoft method of Globalization Namespace.
from sysdvr.
Indeed, I share your view on this one and I guess an XML style or JSON is the best practice approach for it.
I'm not aware of any preexisting libraries for JSON localization, but doing it on your own isn't that difficult.
I would go with a separate project to implement the localization logic, plus I'm not sure about the existing GUI design pattern, but an implementation on MVVM should be easy when the bindable and observable properties are used correctly.
However, I'm way too technical here, as for the translators, I could provide translation in German and Polish.
from sysdvr.
As for design, we are constrained by the lowest common denominator for cross platform.
In particular on desktop I use AOT to build framework-less binaries (so no reflection) and on android the same to build as a dynamic library I can call from Java.
Essentially, the application is a console app with sdl and imgui, which is an immediate mode gui that runs in a loop, kinda like a game engine.
Such is the unfortunate state of cross platform user interfaces that are not a web browser.
from sysdvr.
Depending on which platforms you aim for, MAUI (former XAMARIN) is also a good approach, it aims at MVVM which implies cross-platform compatibility by strict encapsulation. AOT is common all over the .NET framework anyways and native Java library is used in the android part of MAUI.
However, with your approach using SDL/OpenGL makes it somehow independent and more versatile, but also more work to do since you have to build the layout, pages, behaviors (which imgui helps alot with) etc. yourself, also the architecture of the application.
Tbh, I am not familiar with the latest state of the project and I just saw that you released 6.0 last week so I'll definitely give it a shot. Keep up the good work!
from sysdvr.
Last time i tried MAUI it did not feel stable yet, i did considering trying UNO or Avalonia though. The main problem that made me pick SDL in the end is the video renderer.
Truns out there is no "batteries included" library that allows playing raw video data without a proper container so i had to manually use ffmpeg which produces a framebuffer for each frame decoded. SDL gives me the low level flexibility of making a double buffered GPU renderer that does not allocate memory for each frame, other WPF-like frameworks did not seem to support this in a cross-platform way at the time i looked into it.
from sysdvr.
pl-PL here if needed!
from sysdvr.
I made some initial work in the translation-support branch. This is still experimental, do not start translating yet.
Translation files will look like this:
{
"translationName": "English",
"translationAuthor": "SysDVR",
"systemLocale": [
"en-us"
],
"imGuiGlyphRange": "Default", // optional
"fontName": "OpenSans.ttf", // optional
"mainGUI_ChannelLabel": "Select the streaming mode",
"mainGUI_ChannelVideo": "Video only",
"mainGUI_ChannelAudio": "Audio only",
// etc...
}
Of particular interest are the imGuiGlyphRange
and fontName
fields. These can be used to add support for other alphabets. In particular the first field must be one of these values and the latter the name of a font file to be embedded in the resources folder.
The systemLocale
array contains which system locales are covered by this file so on first launch sysdvr will already match the system language, users will still be able to change it from the settings.
To be included in SysDVR, fonts will have to be distributed under an open license, a good example is Google Noto which seems to implement most alphabets.
Any objections to this design ?
Once this is done i'll start to think about what to do with the on-console settings app since that does have some text as well, but uses a different architecture.
from sysdvr.
No objections and instant help if needed.
from sysdvr.
I made some initial work in the translation-support branch. This is still experimental, do not start translating yet.
Translation files will look like this:
{ "translationName": "English", "translationAuthor": "SysDVR", "systemLocale": [ "en-us" ], "imGuiGlyphRange": "Default", // optional "fontName": "OpenSans.ttf", // optional "mainGUI_ChannelLabel": "Select the streaming mode", "mainGUI_ChannelVideo": "Video only", "mainGUI_ChannelAudio": "Audio only", // etc... }Of particular interest are the
imGuiGlyphRange
andfontName
fields. These can be used to add support for other alphabets. In particular the first field must be one of these values and the latter the name of a font file to be embedded in the resources folder.The
systemLocale
array contains which system locales are covered by this file so on first launch sysdvr will already match the system language, users will still be able to change it from the settings.To be included in SysDVR, fonts will have to be distributed under an open license, a good example is Google Noto which seems to implement most alphabets.
Any objections to this design ?
Once this is done i'll start to think about what to do with the on-console settings app since that does have some text as well, but uses a different architecture.
Just my two cents, but instead of using prefixes for the categories, we could use objects.
{
"localeInfo":
{
"author": "SysDVR",
"imGuiGlyphRange": "Default", // optional
"fontName": "OpenSans.ttf" // optional
},
"localization":
{
"mainGui":
{
"channelLabel": "Select the streaming mode",
"channelVideo": "Video only",
"channelAudio": "Audio only"
},
"settings":
{
"settings": "Settings",
}
//etc.
}
}
Another thing about encapsulation comes to the locale array; imho it's better to have separate files for each locale and named it properly inside the locale folder like "en-US.json" "de-DE.json" etc. (filenaming by languagecode) so they can be identified this way.
from sysdvr.
I figured one might want the same language file for multiple locales, on start the app will load all the jsons (deserializing only the metadat fields) and pick the matching locale.
As for encapsulation, I'll think about it, don't see any real advantage cause I can't use fancy techniques like dependency injection or auto mapping to pages. Meant the prefixes as context for translators cause I happened to do some software translating and the lack of context in string files reduces the overall quality if the translator is not paying attention.
from sysdvr.
SysDVR-Client.exe (process 22988) exited with code -1073740940
Happens 6/10 times trying to debug.
There seems to be an AccessViolationExcpetion
in Line 81 of ImFontGlyphRangesBuilder.gen.cs
.
public void Clear()
{
ImGuiNative.ImFontGlyphRangesBuilder_Clear((ImFontGlyphRangesBuilder*)(NativePtr));
}
Maybe NativePtr
didn't got initialized correctly or pointed to a read/write protected part of the memory.
from sysdvr.
Are you using latest commit ? i think I fixed this already. Also provide a stack trace of the crash.
from sysdvr.
Re-reading the code it may also be non zeroed memory in the font builder constructor, but it's weird it didn't trip at all for me during development on both windows and android.
I'll look into it but not before this weekend as I'm busy irl.
from sysdvr.
Okay, I think I fixed it by changing the MemAlloc
to the ImGui native GlyphRangesBuilder.
By testing, 10/10 times runs normally :)
You can find it within my PR for the german translation:
from sysdvr.
only now found some time to look at your fix, I had completely missed that cimgui exposed a wrapper for the constructor. I did some debugging and the issue was indeed not zeroing memory but your fix is probably better.
from sysdvr.
I just added translation support for the on-console settings app, you can find the strings json file here: https://github.com/exelix11/SysDVR/blob/translation-support/SysDVRConfig/romfs/strings/english.json
from sysdvr.
I can help with the translation into Russian
from sysdvr.
I can help with the spanish translation
from sysdvr.
Related Issues (20)
- [Bug] Invalid source on MacBook Pro M1 Pro HOT 5
- top bridge protocol[Help] HOT 4
- [Help] need help with --fullscreen command line HOT 2
- [Help] command "dotnet SysDVR-Client.dll" failed HOT 1
- Updated, now won't stream [Help] HOT 7
- Sysdvr Datamoshing when Streaming Via USB HOT 2
- SysDVR-Client (5.5.5) crashes upon boot HOT 2
- [Help] rPi4-b works well with 1080p monitors using network. When plugged into a 4k TV, the resolution sets to 4k and the pi can't decode fast enough. HOT 3
- Flatpak version crashes when saving settings HOT 4
- [Bug] cannot connect network with v6.0.0 HOT 11
- [Bug] Error reading next packet: Warning: libusb error Timeout while reading header HOT 3
- [Help] My switch is always in host mode and charging my computer HOT 3
- Please add armv7a armebi for Android TV and older Tablets Smartphones HOT 2
- [Bug] OSX Crashing on TCP WiFi mod HOT 8
- [Feature request] Android screen rotation lock HOT 2
- [Help]无法安装驱动 HOT 4
- [Feature request] HOT 3
- [Help] unable to detected the sysDVR device ID and my switch show me couldn't connect to sysDVR HOT 16
- [Feature request] OSX and Volume Control HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sysdvr.