String IDs in the site do not match IDs in JSON files by espoem

View this thread on steempeak.com
· @espoem ·
$23.91
String IDs in the site do not match IDs in JSON files
I'm going to present an issue regarding the strings in staging.busy.org. There are cases when the id of the used string does not match the string in the locale JSON files. It results in text that is translated but the translation is not visible on the site.

## VoteActionMessage.js

|VoteActionMessage.js|en.json|text|
|-|-|-|
|user_upvoted_post|user_upvoted|"{username} upvoted"|
|user_downvoted_post|user_downvoted|"{username} downvoted"|
|user_unvoted_post|user_unvoted|"{username} unvoted"|
|voting_weight|vote_weight|"Vote weight"|

![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1513024607/oifbrxjbul9agqgliexe.png)

![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1513024612/i6bkbzqqalhbgem7bkel.png)

![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1513024617/jj0ycs8uufsuitrde37x.png)

![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1513024932/ddod7sa287ymmbnmtvo7.png)

You can see [here](https://github.com/busyorg/busy/blob/master/src/client/locales/cs.json) that the strings were translated to Czech. The mismatching IDs causes trouble and the strings would actually not be seen as translated.

Another issue is that the messages with IDs in {upvoted, downvoted, unvoted} are capitalized although the text should have only the first letter in capital.

## Error401.js

This file contains a message for the page warning the user that hey have to login to proceed. You can see it if you go to <staging.busy.org/wallet> while not logged in.

|Error401.js|en.json|
|-|-|
|`@statics/need_login`|missing|
|`@statics/here_link`|missing|
|`@statics/homepage`|missing|

You can see that I tried to fix this minor issue in a [PR](https://github.com/busyorg/busy/pull/1163) but Sekhmet also suggested another change that would require more knowledge. First new ids were suggested so that they are easier to recognize.

|old ID| new ID|
|-|-|
|need_login|login_required|
|homepage|homepage_link|
|here_link|??|

![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1513028075/rvcslhiuro2b1w6rtfnv.png)

```
<p>
  <FormattedMessage
    id="@statics/need_login"
    defaultMessage="You need to login to use this feature, please"
  />{' '}
  <a href={SteemConnect.getLoginURL()}>
  <FormattedMessage id="login" defaultMessage="Login" />
  </a>
  <br />
  <FormattedMessage id="@statics/here_link" defaultMessage="Here's a link to the" />
  <Link to="/">
  <FormattedMessage id="@statics/homepage" defaultMessage="home page" />
  </Link>
   .
</p>
```

I had one solution in mind regarding no prior knowledge of JS or React. I changed the ids and merged some strings together in order to work with them easily. This, however, doesn't work well.

```
<FormattedMessage
  id="login_required"
  defaultMessage="You need to {login} to use this feature."
  values={{
    login: <Link to={SteemConnect.getLoginURL()}>login</Link>,
  }}
/>
<br />
<FormattedMessage
  id="homepage_link"
  defaultMessage="Here's a link to the {home_page}."
  values={{
    home_page: <Link to="/">home page</Link>,
  }}
/>
```

To have the link embedded in the string, it should probably look like this. This is probably incorrect way of doing it but it is only a suggestion and my way of understanding the issue. Those sentences must be easy to manipulate so that they can be translated without difficulties.

```
<FormattedMessage
  id="login_required"
  defaultMessage="You need to <a href="{SteemConnect.getLoginURL()}">login</a> to use this feature."
/>
<br />
<FormattedMessage
  id="homepage_link"
  defaultMessage="Here's a link to the <a href="/">home page</a>."
/>
```

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@espoem/string-ids-in-the-site-do-not-match-ids-in-json-files">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
post_id20,145,372
authorespoem
permlinkstring-ids-in-the-site-do-not-match-ids-in-json-files
categoryutopian-io
json_metadata"{"type": "bug-hunting", "repository": {"id": 64382195, "watchers": 137, "events_url": "https://api.github.com/repos/busyorg/busy/events", "forks": 56, "name": "busy", "issues_url": "https://api.github.com/repos/busyorg/busy/issues{/number}", "trees_url": "https://api.github.com/repos/busyorg/busy/git/trees{/sha}", "fork": false, "git_url": "git://github.com/busyorg/busy.git", "assignees_url": "https://api.github.com/repos/busyorg/busy/assignees{/user}", "size": 60238, "owner": {"id": 25360286, "following_url": "https://api.github.com/users/busyorg/following{/other_user}", "starred_url": "https://api.github.com/users/busyorg/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/busyorg/subscriptions", "repos_url": "https://api.github.com/users/busyorg/repos", "login": "busyorg", "gists_url": "https://api.github.com/users/busyorg/gists{/gist_id}", "followers_url": "https://api.github.com/users/busyorg/followers", "received_events_url": "https://api.github.com/users/busyorg/received_events", "type": "Organization", "avatar_url": "https://avatars0.githubusercontent.com/u/25360286?v=4", "site_admin": false, "organizations_url": "https://api.github.com/users/busyorg/orgs", "gravatar_id": "", "events_url": "https://api.github.com/users/busyorg/events{/privacy}", "url": "https://api.github.com/users/busyorg", "html_url": "https://github.com/busyorg"}, "forks_count": 56, "git_refs_url": "https://api.github.com/repos/busyorg/busy/git/refs{/sha}", "blobs_url": "https://api.github.com/repos/busyorg/busy/git/blobs{/sha}", "pushed_at": "2017-12-11T21:11:20Z", "watchers_count": 137, "teams_url": "https://api.github.com/repos/busyorg/busy/teams", "comments_url": "https://api.github.com/repos/busyorg/busy/comments{/number}", "archived": false, "svn_url": "https://github.com/busyorg/busy", "merges_url": "https://api.github.com/repos/busyorg/busy/merges", "subscribers_url": "https://api.github.com/repos/busyorg/busy/subscribers", "issue_events_url": "https://api.github.com/repos/busyorg/busy/issues/events{/number}", "stargazers_url": "https://api.github.com/repos/busyorg/busy/stargazers", "mirror_url": null, "statuses_url": "https://api.github.com/repos/busyorg/busy/statuses/{sha}", "has_projects": true, "milestones_url": "https://api.github.com/repos/busyorg/busy/milestones{/number}", "description": "Blockchain-based social network where anyone can earn rewards \ud83d\ude80", "keys_url": "https://api.github.com/repos/busyorg/busy/keys{/key_id}", "open_issues": 69, "compare_url": "https://api.github.com/repos/busyorg/busy/compare/{base}...{head}", "ssh_url": "git@github.com:busyorg/busy.git", "license": {"name": "MIT License", "key": "mit", "url": "https://api.github.com/licenses/mit", "spdx_id": "MIT"}, "html_url": "https://github.com/busyorg/busy", "commits_url": "https://api.github.com/repos/busyorg/busy/commits{/sha}", "open_issues_count": 69, "stargazers_count": 137, "branches_url": "https://api.github.com/repos/busyorg/busy/branches{/branch}", "full_name": "busyorg/busy", "forks_url": "https://api.github.com/repos/busyorg/busy/forks", "score": 101.894325, "deployments_url": "https://api.github.com/repos/busyorg/busy/deployments", "contributors_url": "https://api.github.com/repos/busyorg/busy/contributors", "homepage": "https://busy.org/", "contents_url": "https://api.github.com/repos/busyorg/busy/contents/{+path}", "has_downloads": true, "collaborators_url": "https://api.github.com/repos/busyorg/busy/collaborators{/collaborator}", "created_at": "2016-07-28T09:27:04Z", "git_commits_url": "https://api.github.com/repos/busyorg/busy/git/commits{/sha}", "releases_url": "https://api.github.com/repos/busyorg/busy/releases{/id}", "private": false, "pulls_url": "https://api.github.com/repos/busyorg/busy/pulls{/number}", "git_tags_url": "https://api.github.com/repos/busyorg/busy/git/tags{/sha}", "notifications_url": "https://api.github.com/repos/busyorg/busy/notifications{?since,all,participating}", "language": "JavaScript", "updated_at": "2017-12-06T00:16:52Z", "has_wiki": true, "downloads_url": "https://api.github.com/repos/busyorg/busy/downloads", "hooks_url": "https://api.github.com/repos/busyorg/busy/hooks", "languages_url": "https://api.github.com/repos/busyorg/busy/languages", "default_branch": "master", "labels_url": "https://api.github.com/repos/busyorg/busy/labels{/name}", "url": "https://api.github.com/repos/busyorg/busy", "has_pages": false, "tags_url": "https://api.github.com/repos/busyorg/busy/tags", "clone_url": "https://github.com/busyorg/busy.git", "archive_url": "https://api.github.com/repos/busyorg/busy/{archive_format}{/ref}", "has_issues": true, "issue_comment_url": "https://api.github.com/repos/busyorg/busy/issues/comments{/number}", "subscription_url": "https://api.github.com/repos/busyorg/busy/subscription"}, "pullRequests": [], "format": "markdown", "image": ["https://res.cloudinary.com/hpiynhbhq/image/upload/v1513024607/oifbrxjbul9agqgliexe.png"], "links": ["https://res.cloudinary.com/hpiynhbhq/image/upload/v1513024607/oifbrxjbul9agqgliexe.png", "https://res.cloudinary.com/hpiynhbhq/image/upload/v1513024612/i6bkbzqqalhbgem7bkel.png", "https://res.cloudinary.com/hpiynhbhq/image/upload/v1513024617/jj0ycs8uufsuitrde37x.png", "https://res.cloudinary.com/hpiynhbhq/image/upload/v1513024932/ddod7sa287ymmbnmtvo7.png", "https://github.com/busyorg/busy/blob/master/src/client/locales/cs.json", "https://github.com/busyorg/busy/pull/1163", "https://res.cloudinary.com/hpiynhbhq/image/upload/v1513028075/rvcslhiuro2b1w6rtfnv.png"], "app": "utopian/1.0.0", "platform": "github", "tags": ["utopian-io", "busy", "czech", "translation", "bug"], "community": "utopian", "users": ["statics"]}"
created2017-12-11 21:40:21
last_update2017-12-11 21:40:21
depth0
children3
net_rshares5,948,242,227,678
last_payout2017-12-18 21:40:21
cashout_time1969-12-31 23:59:59
total_payout_value17.600 SBD
curator_payout_value6.306 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length3,819
author_reputation59,186,440,518,630
root_title"String IDs in the site do not match IDs in JSON files"
beneficiaries
0.
accountcnts
weight10
1.
accountdamla
weight22
2.
accountfreedom
weight658
3.
accountnetuoso
weight6
4.
accountsimnrodrguez
weight21
5.
accounttransisto
weight70
6.
accountutopian-io
weight536
7.
accountxeldal
weight27
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (35)
@drigweeu ·
Thank you for the contribution. It has been approved.

You can contact us on [Discord](https://discord.gg/UCvqCsx).
**[[utopian-moderator]](https://utopian.io/moderators)**
properties (22)
post_id20,145,605
authordrigweeu
permlinkre-espoem-string-ids-in-the-site-do-not-match-ids-in-json-files-20171211t214341366z
categoryutopian-io
json_metadata"{"app": "busy/1.0.0", "community": "busy", "tags": ["utopian-io"]}"
created2017-12-11 21:44:06
last_update2017-12-11 21:44:06
depth1
children0
net_rshares0
last_payout2017-12-18 21:44:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length172
author_reputation9,697,653,591,082
root_title"String IDs in the site do not match IDs in JSON files"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@utopian-1up ·
$0.40
<div class="pull-left">

![1up-logo.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1512204274/pbwgsxljk7f8ql2slbs9.png)



</div>

<div class="text-justify">

<br>

You've got a <code>1UP</code> from the @utopian-1up curation trail. __24 Utopians__ have upvoted your quality contribution to the open source community. 

<code>[Join](https://steemit.com/utopian-io/@flauwy/steemy-ep-46-how-to-create-and-follow-a-curation-trail-with-steemauto) 1UP for better posts and high curation rewards.</code>

_1UP is neither organized nor endorsed by Utopian.io!_

</div>
👍  ,
properties (23)
post_id20,178,062
authorutopian-1up
permlinkre-espoem-string-ids-in-the-site-do-not-match-ids-in-json-files-20171212t054319544z
categoryutopian-io
json_metadata"{"app": "busy/2.1.0", "community": "busy", "tags": ["utopian-io"]}"
created2017-12-12 05:43:27
last_update2017-12-12 05:43:27
depth1
children0
net_rshares88,393,947,494
last_payout2017-12-19 05:43:27
cashout_time1969-12-31 23:59:59
total_payout_value0.304 SBD
curator_payout_value0.098 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length570
author_reputation2,326,305,067,153
root_title"String IDs in the site do not match IDs in JSON files"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (2)
@utopian-io ·
### Hey @espoem I am @utopian-io. I have just upvoted you!
#### Achievements
- You have less than 500 followers. Just gave you a gift to help you succeed!
- Seems like you contribute quite often. AMAZING!
#### Suggestions
- Contribute more often to get higher and higher rewards. I wish to see you often!
- Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!
#### Get Noticed!
- Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!
#### Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. <a href="https://discord.gg/zTrEMqB">Participate on Discord</a>. Lets GROW TOGETHER!
- <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for my Witness With SteemConnect</a>
- <a href="https://v2.steemconnect.com/sign/account-witness-proxy?proxy=utopian-io&approve=1">Proxy vote to Utopian Witness with SteemConnect</a>
- Or vote/proxy on <a href="https://steemit.com/~witnesses">Steemit Witnesses</a>

[![mooncryption-utopian-witness-gif](https://steemitimages.com/DQmYPUuQRptAqNBCQRwQjKWAqWU3zJkL3RXVUtEKVury8up/mooncryption-s-utopian-io-witness-gif.gif)](https://steemit.com/~witnesses)

**Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x**
properties (22)
post_id20,267,166
authorutopian-io
permlinkre-espoem-string-ids-in-the-site-do-not-match-ids-in-json-files-20171213t000936429z
categoryutopian-io
json_metadata"{"app": "utopian/1.0.0", "community": "utopian", "tags": ["utopian-io"]}"
created2017-12-13 00:09:36
last_update2017-12-13 00:09:36
depth1
children0
net_rshares0
last_payout2017-12-20 00:09:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length1,504
author_reputation152,913,012,544,965
root_title"String IDs in the site do not match IDs in JSON files"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000