-
Notifications
You must be signed in to change notification settings - Fork 3
Globalize #54
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
Open
Setogit
wants to merge
4
commits into
master
Choose a base branch
from
globalize
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Globalize #54
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| usage: {{%MAIN% [options] [URL [PACK|BRANCH]]}} | ||
|
|
||
| Deploy a node application to a StrongLoop process manager | ||
|
|
||
| Options: | ||
| {{-h,--help}} Print this message and exit. | ||
| {{-v,--version}} Print version and exit. | ||
| {{-s,--service SVC}} Deploy to service {{SVC}}. | ||
| {{-z,--size SIZE}} Set size of cluster to {{SIZE}} before deploy. | ||
|
|
||
| Arguments: | ||
| {{SIZE}}: A number, n, or the string '{{cpus}}', meaning run a worker per CPU. | ||
|
|
||
| {{SVC}}: The name or ID of the service on the process manager. | ||
|
|
||
| Defaults to the name of the application specified in the {{package.json}} file. | ||
|
|
||
| If a service with that name is not available on the process manager, a new service will be created and the application will be deployed. | ||
|
|
||
| {{URL}}: The {{URL}} of the StrongLoop process manager. | ||
|
|
||
| Defaults to `{{http://localhost:8701}}`. If a {{URL}} is provided, both the host and port is optional, they default to `{{localhost}}` and 8701, respectively. If the server requires authentication, the credentials must be part of the URL, see examples. | ||
|
|
||
| URL may also use the `{{http+ssh://}}` protocol which will connect using {{ssh}} and then tunnel the http requests over that connection. The {{ssh username}} will default to your current user and authentication defaults to using your current {{ssh-agent}}. The {{username}} can be overridden by setting an `{{SSH_USER}}` environment variable. The authentication can be overridden to use an existing private key instead of an agent by setting the `{{SSH_KEY}}` environment variable to the path of the private key to be used. The port used for ssh can be overridden by setting an `{{SSH_PORT}}` environment ariable. | ||
|
|
||
| {{PACK}}: Deploy an {{NPM package/tarball}}. | ||
|
|
||
| {{BRANCH}}: Deploy a {{git}} branch. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. git did, so npm does need protection
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure |
||
|
|
||
| Default behaviour is to deploy to `{{http://localhost:8701}}`. An {{npm}} package from the parent directory is deployed, if one is found for the current application version, otherwise the {{git}} branch `{{deploy}}` is deployed. | ||
|
|
||
| Note that if {{PACK}} or {{BRANCH}} is specified, {{URL}} *must* be specified as well. | ||
|
|
||
| Examples: | ||
|
|
||
| Deploy the default {{npm}} package or {{git}} branch to {{localhost}}: | ||
|
|
||
| {{%MAIN%}} | ||
|
|
||
| Deploy the default {{npm}} package or {{git}} branch to a remote host: | ||
|
|
||
| {{%MAIN% http://prod1.example.com}} | ||
|
|
||
| Deploy to a remote host, on a non-standard port, using authentication: | ||
|
|
||
| {{%MAIN% http://user:pass@prod1.example.com:8765}} | ||
|
|
||
| Deploy '{{production}}' branch to {{localhost}}: | ||
|
|
||
| {{%MAIN% http://localhost production}} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am trying to find the globalize docs for this
{ key}, {key: value}syntax, where are they?Some tools do:
glb.error('this {$1} is a {$2}, 'statue', 'dog')... basically keys prefixed with a$` are positional args. its more concise for some uses. Does globalize support this? If not, maybe we can suggest it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strong-globalize supports both glb.error('this {0} is a {1}, ['statue', 'dog']) and glb.error('this {statue} is a {dog}, {statue: 'statue', dog: 'dog'}). i don't think we want to advertise the former notation, do we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not? Its way more concise, and its concision makes it less error prone to use, particularly when converting from code that already uses positional args. Note the error you made at #54 (comment). Its easy to do that kind of thing, and its particularly bad because there are _three_ identical strings that must be identical, or the code is broken, and made worse because unit tests to cover this kind of thing are hard to build. The above is an error case, and we often don't test the exact message output from CLIs, particularly for errors, the tests are hard to build and fragile, but the effect is bugs like the above are easy to miss, and easy to create during what is a rote, bulk translation exercise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opened the gate in strong=globalize/lint for {0}, {1}, .. placeholder names.
var dt = glb.d(new Date());
"{dateTime} Hello World"
glb.t('{dateTime} Hello World', {dateTime: dt});
"{0} Hello World"
glb.t('{0} Hello World', {0: dt});
"{0} Hello World"
glb.t('{0} Hello World', [dt]);
They are all supported. I think the former gives more context to the human translator. No difference for machines.