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

Fix/lingo germany #8269

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion core/wiki/macros/lingo.tid
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,17 @@ $:/language/
<!-- First try the old school <active-lingo-base><title> format -->
<$transclude $tiddler={{{ [<active-lingo-base>addsuffix<title>] }}} $mode=<<parseMode>>>
<!-- If that didn't work, try the new <lingo-base><langcode>/<title> format -->
<!-- Get active language, if not language is selected, fallback to English -->
<$let language-code={{{ [[$:/language]get[text]get[name]else[en-GB]] }}}>
<$transclude $tiddler={{{ [<active-lingo-base>addsuffix<language-code>addsuffix[/]addsuffix<title>] }}} $mode=<<parseMode>>/>
<$transclude $tiddler={{{ [<active-lingo-base>addsuffix<language-code>addsuffix[/]addsuffix<title>] }}} $mode=<<parseMode>>>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent level seems to be wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is 1 level above let, isn't wrong

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. I always put my comments below the issue. So IMO transclude has the wrong indent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

截屏2024-06-19 14 40 54

I didn't see any wrong in vscode

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a look at the file. https://github.com/Jermolene/TiddlyWiki5/blob/e9568720489ae5fe9ee74cd16330b8168028beff/core/wiki/macros/lingo.tid#L20C1-L20C9 Line 20 uses spaces instead of tabs for indentation. If you fix that it should work

<!-- Fallback to its first dependent, like "de-AT" will fallback to "de-DE" in some cases -->
<$let language-code={{{ [[$:/languages/]addsuffix<language-code>get[dependents]removeprefix[$:/languages/]first[]] }}}>
linonetwo marked this conversation as resolved.
Show resolved Hide resolved
<$transclude $tiddler={{{ [<active-lingo-base>addsuffix<language-code>addsuffix[/]addsuffix<title>] }}} $mode=<<parseMode>>>
<!-- When current language and its dependent don't have translation, fallback to English -->
<$transclude $tiddler={{{ [<active-lingo-base>addsuffix[en-GB]addsuffix[/]addsuffix<title>] }}} $mode=<<parseMode>>/>
</$transclude>
</$let>
</$transclude>
</$let>
</$transclude>
</$let>
Expand Down
Loading