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

Help center translations API #48

Merged
merged 7 commits into from May 25, 2016
Merged

Conversation

omgitsads
Copy link
Contributor

https://developer.zendesk.com/rest_api/docs/help_center/translations

Translations API to update article title & body, section title and
category title.


# Since Zendesk2::Request#find! calls .to_i on hash keys, we need an integer
# key for this.
key = [source_type, source_id, locale].join("-").each_byte.inject(0) {|char, acc| acc + char }
Copy link
Owner

Choose a reason for hiding this comment

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

we should either pull this function up or lift the to_i restriction on find!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I seem to recall the to_i restriction was because of people using :symbol and "text" keys for the service.data hash? I'll pull this into a class method.

https://developer.zendesk.com/rest_api/docs/help_center/translations

Translations API to update article title & body, section title and
category title.
Typo in categories URL. Allow filtering with `locale` or `locales`
arguments when listing translations
Extracted out the shared methods in various request classes to the
`TranslationSource` module. Also pulled out the `source=` method into
the module.
Check if the params has the `translations` key when looking for
`source_id` and `source_type`. If it doesn't then look at the root of
the params for the attributes. This way we can reuse the module for all
our translation requests.
@lanej lanej merged commit 0dc48dc into lanej:master May 25, 2016
@lanej
Copy link
Owner

lanej commented May 25, 2016

@omgitsads cheers 🍻

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.

None yet

2 participants