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

#364,#365 Add UpdateLegendTitle(newTitle) call and multilingual themes #366

Merged
merged 3 commits into from
Oct 19, 2024

Conversation

kirchsth
Copy link
Member

@kirchsth kirchsth commented Oct 13, 2024

atm all changes (incl. updated documentation) can be tested via my extended branch, therefore all code segments references my extended branch kirchsth/C4-PlantUML/extended instead of the master branch plantuml-stdlib/C4-PlantUML/master

Multilanguage support via language themes

After that I thought it would be a nice feature that we support multiple languages out of the box like the already supported "style" themes and create new "language" themes too.
The only requirement is that matching fonts are installed (the PlantUML online server supports all atm)

The supported language themes are

and can be include like an normal style themes

@startuml
!theme C4Language_japanese from https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/themes
!theme C4_united from https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/themes

!include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Container.puml

LAYOUT_LANDSCAPE()

Person(admin, "管理者")
System_Boundary(c1, 'サンプル') {
    Container(web_app, "ウェブアプリケーション", "C#, ASP.NET Core 2.1 MVC", "複数のTwitterタイムラインを比較することができます")
}
System(twitter, "Twitter")

Rel(admin, web_app, "使用する", "HTTPS")
Rel(web_app, twitter, "ツイートを取得する", "HTTPS")

SHOW_LEGEND()
@enduml

image

All language themes are machine translated. If there are any errors, please let me know that I can fix it.

`UpdateLegendTitle(newTitle)

Based on discussion #363 a new issues was created (#364) and a new UpdateLegendTitle(newTitle) call is added.
This call changes the legen title similar to the other Update....(..., ?legendText, ...) calls which change the legend texts of tags.

Ex. following code:

@startuml
!include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Container.puml

' NEW CALL UpdateLegendTitle
UpdateLegendTitle("Updated legend title")

Person(admin, "Administrator")
System_Boundary(c1, 'Sample') {
    Container(web_app, "Web Application")
}
System(twitter, "Twitter")

SHOW_LEGEND()
@enduml

produces following diagram:

image

BR Helmut

@kirchsth kirchsth self-assigned this Oct 13, 2024
@kirchsth kirchsth added this to the v2.11.0 milestone Oct 13, 2024
@kirchsth
Copy link
Member Author

@Potherca: Arnaud fixed the problem with the "nonworking PlantUML image links" in Github-Markdown context in the meantime too (we need no changes in our documentation).
BR Helmut

@kirchsth kirchsth merged commit dfc29cf into plantuml-stdlib:master Oct 19, 2024
1 check passed
@kirchsth kirchsth deleted the feat/363_364_multilanguage branch October 19, 2024 20:43
@kirchsth
Copy link
Member Author

At the moment the online server displays not working language samples.
It is related to the problem that the online server caches "unchanged diagram sources" for 5 days.
But this check does not consider changed include files. Therefore the images are displayed with old includes (before the merge was approved) until the 5 days are over.

E.g. following image displays the wrong content. But as soon one e.g. space is entered no cache is used and the correct image is displayed on the online server too (the source can be changed via the link of the first image)

https://www.plantuml.com/plantuml/uml/hP5FRzD04CNl-ocsuP14IcqLzSIfmOte8KqZae8uMPjucWJPQskzLgWG4lRo1maG24ehRe0gMa0ge0XnAUs76ThaOp1EItk0OtsnzURDRz_pBiHQA9q4FYlouK3tkUu3T-RhGlOIqGFtjeY4X1XoFG0ETwof8rBWmTf0WiTzw86ab-Y07tEXoAg4Z7sXQQZ3aCtag_-7hgamu7sje_YARIinj7eK8UaaCQXkA3L8RNN3m8vy8VECix7s_477TkPdcxcqkbot0n5hKFRqZ9ZD36JNJpou42X9haCRWdegAo8lO_NghPNLjbklDXPRJhLPAvKPQuAAGraINZ2G5LuOxxqVltmqkV-mK6QjTG85xjKmaPvGwwNkN8KNCVk1PeHc2ysNOfdVPPoUiuDAG-Yu8eg8XDb7p7RGR6BsOMh_ZDbtDFkO_KH3-gX09kTIXLTRJQjHQnD40RzipV7b6qu-csm_Fdxp3TEzDjqjDSBi4BDjDE_GV9f-Z31xTVnrOx9lC7sBsLDCNsEwY-apJ7SmVOxf0UdKuzvfav8-0H7x54b3TXtyl-tFm__-TJZUs3t1vbcMskrcYzov-SnrZaFpW1BbvSmJ2dNqOlFeOElVRTPQMhdfrclNQer5-lSB83swbpy0

Copy link
Member

@Potherca Potherca left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

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

Successfully merging this pull request may close these issues.

2 participants