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

Reasults match failed due to some special characters #637

Open
QueenaHalifax opened this issue Dec 12, 2024 · 6 comments
Open

Reasults match failed due to some special characters #637

QueenaHalifax opened this issue Dec 12, 2024 · 6 comments

Comments

@QueenaHalifax
Copy link

I noticed that when the sentence to be translated contains some special characters, the translator is not able to match the sentence with the results saved in _AutoGeneratedTranslations.txt correctly.

Here is an example:
The sentense is 「え、えっと…その…お兄さんと一緒に帰りたかったからです///」
When it is first translated, the following result is written to _AutoGeneratedTranslations.txt:
「え、えっと…その…お兄さんと一緒に帰りたかったからです\/\//」="嗯,嗯……那个……是因为想和哥哥一起回去。".
When the sentence reappears (use Alt+R or restart the game), the translator could not match the result and executed the translation again.
So the _AutoGeneratedTranslations.txt becomes

...
「え、えっと…その…お兄さんと一緒に帰りたかったからです\/\//」="嗯,嗯……那个……是因为想和哥哥一起回去。"
「え、えっと…その…お兄さんと一緒に帰りたかったからです\/\//」="嗯,嗯……那个……是因为想和哥哥一起回去。"

I also tried to add

「え、えっと…その…お兄さんと一緒に帰りたかったからです///」=「那,那个…那个…因为我想和哥哥一起回去///」

but it doesn't work.

So this may be a bug in matching results?

My autoTranslator version is 5.3.1 and my config.ini is

[Service]
Endpoint=PapagoTranslate
FallbackEndpoint=DeepLTranslate

[General]
Language=zh
FromLanguage=ja

[Files]
Directory=Translation\{Lang}\Text
OutputFile=Translation\{Lang}\Text\_AutoGeneratedTranslations.txt
SubstitutionFile=Translation\{Lang}\Text\_Substitutions.txt
PreprocessorsFile=Translation\{Lang}\Text\_Preprocessors.txt
PostprocessorsFile=Translation\{Lang}\Text\_Postprocessors.txt

[TextFrameworks]
EnableIMGUI=True
EnableUGUI=True
EnableNGUI=True
EnableTextMeshPro=True
EnableTextMesh=True
EnableFairyGUI=True

[Behaviour]
MaxCharactersPerTranslation=2500
IgnoreWhitespaceInDialogue=True
MinDialogueChars=20
ForceSplitTextAfterCharacters=0
CopyToClipboard=False
MaxClipboardCopyCharacters=2500
ClipboardDebounceTime=1.25
EnableUIResizing=True
EnableBatching=True
UseStaticTranslations=True
OverrideFont=
OverrideFontSize=
OverrideFontTextMeshPro=LiberationSans.ttf
FallbackFontTextMeshPro=arialuni_sdf_u2019
ResizeUILineSpacingScale=
ForceUIResizing=False
IgnoreTextStartingWith=\u180e;
TextGetterCompatibilityMode=False
GameLogTextPaths=
RomajiPostProcessing=ReplaceMacronWithCircumflex;RemoveApostrophes;ReplaceHtmlEntities
TranslationPostProcessing=ReplaceMacronWithCircumflex;ReplaceHtmlEntities
RegexPostProcessing=
CacheRegexPatternResults=False
PersistRichTextMode=Final
CacheRegexLookups=False
CacheWhitespaceDifferences=False
GenerateStaticSubstitutionTranslations=True
GeneratePartialTranslations=False
EnableTranslationScoping=True
EnableSilentMode=True
BlacklistedIMGUIPlugins=
EnableTextPathLogging=False
OutputUntranslatableText=False
IgnoreVirtualTextSetterCallingRules=False
MaxTextParserRecursion=1
HtmlEntityPreprocessing=True
HandleRichText=True
EnableTranslationHelper=False
ForceMonoModHooks=False
InitializeHarmonyDetourBridge=False
RedirectedResourceDetectionStrategy=AppendMongolianVowelSeparatorAndRemoveAll
OutputTooLongText=False
TemplateAllNumberAway=False
ReloadTranslationsOnFileChange=False
DisableTextMeshProScrollInEffects=True
CacheParsedTranslations=False

[Texture]
TextureDirectory=Translation\{Lang}\Texture
EnableTextureTranslation=False
EnableTextureDumping=False
EnableTextureToggling=False
EnableTextureScanOnSceneLoad=False
EnableSpriteRendererHooking=False
LoadUnmodifiedTextures=False
DetectDuplicateTextureNames=False
DuplicateTextureNames=
EnableLegacyTextureLoading=False
TextureHashGenerationStrategy=FromImageName
CacheTexturesInMemory=True
EnableSpriteHooking=False

[ResourceRedirector]
PreferredStoragePath=Translation\{Lang}\RedirectedResources
EnableTextAssetRedirector=False
LogAllLoadedResources=False
EnableDumping=False
CacheMetadataForAllFiles=True

[Http]
UserAgent=
DisableCertificateValidation=True

[TranslationAggregator]
Width=400
Height=100
EnabledTranslators=

[Debug]
EnableConsole=False

[Migrations]
Enable=True
Tag=5.3.1

[Baidu]
BaiduAppId=
BaiduAppSecret=
DelaySeconds=1

[BingLegitimate]
OcpApimSubscriptionKey=

[Custom]
Url=

[DeepL]
ExecutableLocation=
MinDelaySeconds=2
MaxDelaySeconds=6

[DeepLLegitimate]
ExecutableLocation=
ApiKey=
Free=False

[ezTrans]
InstallationPath=

[Google]
ServiceUrl=

[GoogleV2]
ServiceUrl=
RPCID=MkEWBc
VERSION=boq_translate-webserver_20210323.10_p0
UseSimplest=False

[GoogleLegitimate]
GoogleAPIKey=

[LecPowerTranslator15]
InstallationPath=

[LingoCloud]
LingoCloudToken=

[Watson]
Url=
Key=

[Yandex]
YandexAPIKey=
@ManlyMarco
Copy link
Collaborator

Try 「え、えっと…その…お兄さんと一緒に帰りたかったからです\/\/\/」="

@QueenaHalifax
Copy link
Author

Try 「え、えっと…その…お兄さんと一緒に帰りたかったからです\/\/\/」="

Thank you for your reply.
I tried but it doesn't work either.

@Lmeks
Copy link
Contributor

Lmeks commented Dec 14, 2024

Seems unsolvable, use r:"「え、えっと…その…お兄さんと一緒に帰りたかったからです...」"= for now
TextHelper can't pass // in any way

@Lmeks
Copy link
Contributor

Lmeks commented Dec 14, 2024

Gotta fix this AND disable parsing for regex which is unnecessary torture.
I don't think there' a long way for backwards compatibility.

I also had a bug which deletes all comments and empty lines from translation files, idk whether it's related.

@QueenaHalifax
Copy link
Author

Gotta fix this AND disable parsing for regex which is unnecessary torture. I don't think there' a long way for backwards compatibility.

I also had a bug which deletes all comments and empty lines from translation files, idk whether it's related.

Thank you for the explanation.
As for regex, I have another problem.
I can't specify a regex to the translator.
I try to add a Standard Regex into _AutoGeneratedTranslations.txt like

r:"^駅に到着まで([0-9]+)$分"=到达车站前$1分钟
r:"駅に到着まで([0-9]+)$分"=到达车站前$1分钟

But translator doesn't understand this, and it still translates 駅に到着まで14分=14分钟后到达车站.
I believe I made a mistake with the settings but I'm not sure where it was. Could you help me?

@Lmeks
Copy link
Contributor

Lmeks commented Dec 15, 2024

It won't find anything because $ means end of the string in regex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants