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

Footer Component #70

Merged
merged 6 commits into from
Feb 7, 2018
Merged

Footer Component #70

merged 6 commits into from
Feb 7, 2018

Conversation

jmb521
Copy link
Contributor

@jmb521 jmb521 commented Feb 6, 2018

I attempted to complete the language changes, however I was unsuccessful.

@Simply007
Copy link
Contributor

@jmb521 Thank you! This is exactly what we wanted.

I went through the the changes and everything looks fine.

According to multilingual support:
You can get inspired by i.e. translation of OurStory component:
d102d00

  1. It is necessary to add translation to local files with appropriate codenames:
    i.e.:
{
...
"Footer" :    {
    "codename" : "Some translation we want to add to the footer"
    }    
}
  • src/Localization/en-US.json
  • src/Localization/es-ES.json
  1. Encapsulate component to the HOC on src/Components/Footer.js:
import { translate } from 'react-translate'
...
const Footer = (props) => {
...
}
export default translate("OurStory")(OurStory); 
  1. use {props.t("codename")} to get the content in the localization json

Hint:
You can use parameters in resource strings:
https://www.npmjs.com/package/react-translate

Some more info:
Application loads all json files in folder /src/Localization https://github.com/Kentico/cloud-sample-app-react/blob/master/src/Utilities/LocalizationLoader.js and stores them as an initial object for TranslatorProvider https://github.com/Kentico/cloud-sample-app-react/blob/master/src/LocalizedApp.js#L46 from package https://www.npmjs.com/package/react-translate.

Copy link
Contributor

@Simply007 Simply007 left a comment

Choose a reason for hiding this comment

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

I went through the the changes and everything looks fine.

If you have any questions according the translation - feel free to ask :-)

…h calls to props.t so that the correct language shows up on the footer
@jmb521
Copy link
Contributor Author

jmb521 commented Feb 7, 2018

I made the changes. Not sure what I need to do now, if anything.

@Simply007
Copy link
Contributor

Fixes #65

@Simply007
Copy link
Contributor

Simply007 commented Feb 7, 2018

Thank you, it is awesome to get as precise pull request 👍

Everything you have done is exactly, what was required in this task.

Thank you very much.

If you are looking for another issue to grab, it would be the best to remove two unnecessary fields in the Article model (/Models/Article) described in issue comment:
#55 (comment)

We have also defined a content snippet in the brewer content type (first part of the issue) (https://deliver.kenticocloud.com/975bf280-fd91-488c-994c-2f04416e5ee3/items/aeropress) but we need to decide, how do we want do use them on the sample app. It will be probably something similar as in our .net sample app https://github.com/Kentico/cloud-sample-app-net.

So if you are interested, just let me know and i will prepare the description.

Thanks again :-)

@Simply007 Simply007 merged commit a924247 into kontent-ai:master Feb 7, 2018
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