How do I left align a line in the title of PlantUML - plantuml

How do I left align a line in the title of PlantUML?
#startuml
title
SomeTitle . SomeTitle . SomeTitle . SomeTitle .
<font size=10> Want this left aligned</font>
endtitle
Alice -> Bob: Hello
#enduml
http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuIh9BCb9vGhEpqqD0R4Kz1I8O7FPfENdbIWKPrQbsXeQs2c49m9v9HcPnGevgMab2eavcUbvgIas-Y1LTbnSgNaf46ku77CoarCLTEqKdFAJh1GyKdDoyhaSWD90bm00
I have tried
<font align:left>X</font>
<font text-align:left>Y</font>
I also tried adding left to the title tag.

PlantUML has GraphViz as a rendering engine. It supports \l and \r for left and right aligned:
#startuml
title SomeTitle . SomeTitle . SomeTitle . SomeTitle .\n<font size=10>Want this left aligned</font>\l
Alice -> Bob: Hello
#enduml

Related

Text before and after Router Links in new Line don't have spacing in React

I'm having a strange behaviour and I would like to know if there is a workaround (not talking about .
I'm using react-router and using the <Link> Component.
The code I'm working with looks something like this:
<p className="text-small">
Schon einen Account? - Jetzt einfach hier
<Link to="/anmelden">anmelden</Link>!
</p>
in the frontend the text gets redered as:
Schon einen Account? - Jetzt einfach hieranmelden!
^ no space
While, when using an <a> Tag
<p className="text-small">
Schon einen Account? - Jetzt einfach hier
anmelden!
</p>
The Text gets rendered as:
Schon einen Account? - Jetzt einfach hier anmelden!
^ space
Sure, I could use right after "hier" or write the paragraph as one line instead of a linebreak, but I'd like to keep the code as readable as possible and the content itself might come from a translation file in the future. Is there any way I could force react to display the " " when using a linebreak?

Is there a way to place node name to the right in PlantUML?

To increase readability I would like to place (interface) node names to the right of the node. Is this somehow possible?
#startuml
left to right direction
() "longer_interface_name" as interface
[component one] --> interface
[component two] --> interface
[component three] --> interface
[component four] --> interface
[component five] --> interface
#enduml
leads to
but I'd like to have something like

CakePHP Localization of static data

CakePHP Version: 3.6.6
I apologise in advance for such a long post but I believe this is all the information needed for someone to be able to help.
===========================================================================
SECTION 1
// WHAT I'D LIKE' TO ACHIEVE
Ultimately I'd like my application to automatically detect the language of the user and change the following accordingly:
Text.
Date format.
Number format.
Currency.
In an effort to realise this I started by simplifying it by not attempting to automatically detect the language of the user but manually changing the locale in config/app.php.
===========================================================================
SECTION 2
// THE INFORMATION I'VE REFERENCED
Internationalization & Localization - Here
I18N Shell - Here
===========================================================================
SECTION 3
// WHAT I HAVE BEFORE I START
config/app.php
'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_GB'),
config/bootstrap.php
ini_set('intl.default_locale', Configure::read('App.defaultLocale'));
// Welcome controller
?php
namespace App\Controller;
use App\Controller\AppController;
use Cake\Event\Event;
// For translation
use Cake\I18n\I18n;
use Cake\I18n\Time;
use Cake\I18n\Number;
class WelcomeController extends AppController
{
public function index()
{
// Get the default locale
$defaultLocale = I18n::getDefaultLocale();
echo $defaultLocale . '<br />';
// Date
$date = new Time('2017-12-05 23:00:00');
echo $date . '<br />';
// Number
echo Number::format(123.50) . '<br />';
// Currency
echo Number::currency(1250.00) . '<br /><br />';
}
}
// index.ctp
<?= __('Welcome') ?>
<br />
<?= __('What would you like to do today!') ?>
// This is what the browser displays
en_GB
05/12/2017, 23:00
123.5
£1,250.00
Welcome
What would you like to do today!
===========================================================================
SECTION 4
// WHAT I'VE DONE
1. Created a folder in src named Locale
2. Created a folder in Locale named de_DE
3. Navigated to the bin with the cli.
4. Typed cake i18n extract and clicked enter.
5. After clicking enter the following is displayed by the cli:
Current paths: None
What is the path you would like to extract?
[Q]uit [D]one
[C:xampp\htdocs\app_name\src] >
I then add the following after > and click enter
C:xampp\htdocs\app_name\src\Template\Welcome
6. After clicking enter the following is displayed by the cli:
Current paths: C:xampp\htdocs\app_name\src\Template\Welcome
What is the path you would like to extract?
[Q]uit [D]one
[D] >
7. I then click enter and the following is displayed by the cli:
Would you like to extract the messages from the CakePHP core? (y/n)
[n] >
8. I then click enter and the following is displayed by the cli:
What is the path you would like to output?
[Q]uit
[C:xampp\htdocs\app_name\src\Template\Welcome\Locale] >
I then add the following after > and click enter
C:xampp\htdocs\app_name\src\Locale
9. I then click enter and the following is displayed by the cli:
Would you like to merge all domain strings into the default.pot file? (y/n)
[n] >
10. I then click enter and the following is displayed by the cli:
Extracting...
Paths: C:xampp\htdocs\app_name\src\Template\Welcome
Output Directory: C:xampp\htdocs\app_name\src\Locale\
====================================================================> 100%
Done.
11. After this I have a default.pot file in the src/Locale folder. I copy and paste this file into the de_DE folder.
The contents of this folder are as below:
# LANGUAGE translation of CakePHP Application
# Copyright YEAR NAME <EMAIL#ADDRESS>
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2018-09-05 09:20+0000\n"
"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n"
"Last-Translator: NAME <EMAIL#ADDRESS>\n"
"Language-Team: LANGUAGE <EMAIL#ADDRESS>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
#: Template/Welcome/index.ctp:52
msgid "Welcome"
msgstr ""
#: Template/Welcome/index.ctp:58
msgid "What would you like to do today!"
msgstr ""
I then add the following into the 2 msgstr so they look like the below:
#: Template/Welcome/index.ctp:52
msgid "Welcome"
msgstr "abc"
#: Template/Welcome/index.ctp:58
msgid "What would you like to do today!"
msgstr "xyz"
I then change the default locale in config/app.php to:
'defaultLocale' => env('APP_DEFAULT_LOCALE', 'de_DE'),
I then refresh the browser and the below is displayed:
de_DE
05.12.15, 23:00
123,5
1.250,00 €
Welcome
What would you like to do today!
===========================================================================
SECTION 5
// RESULT
The locale, date, number and currency have changed but NOT the text. It still displays:
Welcome
What would you like to do today!
And I was expecting it to display:
abc
xyz
===========================================================================
SECTION 6
// WHAT I'VE TRIED TO FIX IT
I added the below to the middleware - Application.php:
// Add middleware and set the valid locales
$middlewareQueue->add(new LocaleSelectorMiddleware(['en_GB', 'de_DE']));
And this is what the browser displayed:
de_DE
05/12/2015, 23:00
123.5
£1,250.00
Welcome
What would you like to do today!
The locale is still de_DE but the date, number and currency have reverted back to English?
===========================================================================
SECTION 7
// SUMMARY
I'd really appreciate any help on this because it would be brilliant if I could get my application localized and have the functionality of allowing a user to use my application in their native language. I'm really restricting my market if I can't get this working.
If there's anything else that I haven't written but you need please don't hesitate to let me know.
Many thanks in advance for any help. Z.
===========================================================================
#ndm - Thanks for the response, learnt a lot already but still no cigar.
I downloaded Poedit and opened it. I then clicked on "Edit a translation" and opened default.pot file from the Locale folder.
Everything looks good and the below is displayed:
Welcome
What would you like to do today!
I then click on 'Create new translation' and select German from the dropdown, the window is divided into 2 halves:
On the left - Source text - English.
On the right - Translation - German.
I highlight 'Welcome' and select the German equivalent 'Willkommen' which is then populated in the right window. I do the same for 'What would you like to do today'.
At this point the right window is populated with the German equivalents so I go to Save as and save the file in my de_DE folder in the src/Locale folder.
My de_DE folder is now populated with 2 files as detailed below:
de.mo
de.po
I open the de.po file and the contents are detailed below:
# LANGUAGE translation of CakePHP Application
# Copyright YEAR NAME <EMAIL#ADDRESS>
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2018-09-05 09:41+0000\n"
"PO-Revision-Date: 2018-09-05 14:26+0100\n"
"Language-Team: LANGUAGE <EMAIL#ADDRESS>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.1.1\n"
"Last-Translator: \n"
"Language: de\n"
#: Template/Welcome/index.ctp:52
msgid "Welcome"
msgstr "Willkommen"
#: Template/Welcome/index.ctp:58
msgid "What would you like to do today!"
msgstr "Was würden Sie heute gerne machen!"
I then clear the cache (tmp/cache/persistent) and refresh the browser.
To confirm I have the below in config/app.php
'defaultLocale' => env('APP_DEFAULT_LOCALE', 'de_DE'),
And I have commented out the middleware reference.
Unfortunately the text has still not been translated?
It seemed like a relatively straight forward process so I'm surprised it hasn't worked. I'm hoping you can see something that I've done incorrectly in the process I've used as documented above.
Thanks again, Z.
// WHAT I'VE TRIED AS A FIX
1. I've tried changing the language definition in config/app.php from:
'defaultLocale' => env('APP_DEFAULT_LOCALE', 'de_DE'),
to
'defaultLocale' => env('APP_DEFAULT_LOCALE', 'de'),
then cleared the cache and refreshed but no luck.
2. I reversed the above then tried changing the language definition in the de.po file from:
"Language: de\n" to de_DE\n
then cleared the cache and refreshed but still no luck.
.pot files are templates (in PO format), you use them to create the final translation files in .po (plain) or .mo (binary) format from them (these are the files that CakePHP is looking for), or to update the latter with changed messages.
You can rename and edit the files manually, or use tools like Poedit that provide a GUI for the gettext tools which can help you with creating/updating .po/.mo files.
Whenever making changes to translation files, remember to clear the cache (tmp/cache/persistent) afterwards!
I know this is a bit late, but for anyone who stumbles across this tread.
Check the permissions of the src/Locale, src/Locale/de_DE and .po &.mo files.
I had a similar issue that the .po and .mo files I had generated were not readable by the web server user, and the translations of text failed silently, as appears to be the case in the OPs question.

Can't see any components on Github.io

When I make a React project on github.io, I can't see any components in Chrome.
In the 'myUserName.github.io' repository, there is a general HTML file. And a directory in the repository is my React project folder:
And the HTML file:
Like these pictures, <div id="root"> is empty. But when I use it on localhost, it does run.
What could be the problem?
------------------- Add source code -----------------------
Directory :
__ index.html (1)
|__ react __ space-trip __ build __ static __ ...
. . . . . . . . . . . . . . . . . . | . . . . . . |__ index.html
. . . . . . . . . . . . . . . . . . |__ node_modules __ ...
. . . . . . . . . . . . . . . . . . |__ public __ index.html (2)
. . . . . . . . . . . . . . . . . . |__ src __ App.js
. . . . . . . . . . . . . . . . . . |. . . . . |__ index.js (3)
. . . . . . . . . . . . . . . . . . |. . . . . |__ registerServiceWorker.js
. . . . . . . . . . . . . . . . . . |__package.json
(1) project's index.html :
<!DOCTYPE html>
...
<body>
<div>Index Page</div>
<a href='./react/space-trip/public/index.html'>Go</a>
<a href='./react/space-trip/build/index.html'>Go - build</a>
</body>
</html>
(2) public/index.html :
<!DOCTYPE html>
<html lang='en'>
<head>
...
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id='root'></div>
</body>
</html>
(3) index.js :
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();
After building this project and I added the url to [build]-[index.html], it's also empty.
I also tried running this page without registerServiceWorker, but it's same.

Getting Syntax errors in PlantUML

I have PlantUML code:
#startuml
hide methods
hide stereotypes
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
!define Enum(name,desc) class name as "desc" << (E,#FFFFAA) >>
!define primary_key(x) <b>x</b>
!define not_null(x) <u>x</u>
!define unique(x) <color:green>x</color>
Enum(menuitemtype,"Menu item types") {
category
text
sticker
user_action
}
Table(menuitem,"Menu item") {
primary_key(id) INTEGER
not_null(unique(name)) VARCHAR[32]
type INTEGER
anonymous BOOLEAN
parent INTEGER
type INTEGER
}
Table(chat,"Telegramm chats") {
primary_key(id) INTEGER
not_null(unique(chat_id)) INTEGER
is_group BOOLEAN
}
Table(requester,"Bot requester") {
primary_key(id) INTEGER
not_null(unique(tele_id)) INTEGER
is_boot BOOLEAN
user_name VARCHAR[32]
last_name VARCHAR[32]
first_name VARCHAR[32]
is_active BOOLEAN
last_access DATETIME
}
menuitem -- menuitemtype
menuitem "0..N" --> "1" menuitem
requester "1" --> "N" chat
#enduml
I take a code from here: https://gist.github.com/QuantumGhost/0955a45383a0b6c0bc24f9654b3cb561
When NetBeans' PlantUML plugin actually displays the structure:
The java tool /usr/share/plantuml/plantuml.jar installed on Ubuntu 16 with apt-get gives follow error:
$ cat SystemDB/schema.puml | plantuml -syntax -v
(0.000 - 119 Mo) 117 Mo - PlantUML Version 8024
(0.048 - 119 Mo) 115 Mo - GraphicsEnvironment.isHeadless() false
ERROR
5
Syntax Error?
and generates follow file
I see that stereotypes are convenience according to: http://plantuml.com/PlantUML_Language_Reference_Guide.pdf - chapter 1.21
On Ubuntu, apt-get installs a (sometimes very) old version of PlantUML, and that's why there are syntax errors.
You can see how to install it using a script, or follow that script to install it by hand. Once you install it that way, you can updated it by downloading the latest .jar file from PlantUML.com.

Resources