plantuml-stdlib / C4-PlantUML

C4-PlantUML combines the benefits of PlantUML and the C4 model for providing a simple way of describing and communicate software architectures
MIT License
6.44k stars 1.1k forks source link

Predefined labels can be translated via language themes #365

Closed kirchsth closed 1 month ago

kirchsth commented 1 month ago

At the moment, many (legend) labels are predefined with English text. If a user wants to create a diagram in another language, such as Japanese, it is very difficult to translate all labels in the diagram code manually (some are even hard coded).

Therefore, it should be possible to include a corresponding language theme so that all predefined labels (not just the legend texts) are translated into the desired language.

For example, a diagram with the following code currently has only an English legend:

@startuml

' without language theme legend remains English  
' !theme C4Language_japanese from https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/themes

!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/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

and if the theme is included like

...
!theme C4Language_japanese from https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/themes
...

then it should look like

image

Potherca commented 1 month ago

@kirchsth This looks resolved by https://github.com/plantuml-stdlib/C4-PlantUML/pull/366, should this issue be closed?

kirchsth commented 1 month ago

Yes, the Github caching problem is solved in the meantime and all images are correct displayed

(I cleaned the Github chache with curl -X PURGE, I explained the details in a comment at the end of the forum entry )

kirchsth commented 1 month ago

@Potherca: with the PlantUML-server I have sometimes also a problem with the cache itself, therefore I entered a similar request for the PlantUML-server in forum (but it doesn't have the high priority for me at the moment)