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

Support translations records #516

Merged
merged 4 commits into from
Feb 9, 2022

Conversation

fabiensebban
Copy link
Contributor

TL;DR -- This supports translations for records that have access to


This allow to get translations from objects. Here is an example of translation that can be found in an item:

 <listAcct:translationsList>
      <listAcct:translation>
        <listAcct:locale>_englishUK</listAcct:locale>
        <listAcct:language>English (UK)</listAcct:language>
        <listAcct:displayName>Display Name</listAcct:displayName>
        <listAcct:salesDescription>Sales description</listAcct:salesDescription>
      </listAcct:translation>
 </listAcct:translationsList>

As each record can have its own translation fields, the Translation records fields are generated dynamically.

include Namespaces::ListAcct

def initialize(attributes = {})
initialize_from_dynamic_attributes_hash(attributes)
Copy link
Member

Choose a reason for hiding this comment

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

@fabiensebban Why did this need to use a new dynamic attributes approach? Are the fields included here dynamic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you @iloveitaly for pointing that out. I first thought Translation was a dynamic NetSuite object. After reviewing the documentation I realized translation's fields are always the same. I Just change it in my next commit.

@iloveitaly
Copy link
Member

Thank you!

@iloveitaly iloveitaly merged commit 3838e11 into NetSweet:master Feb 9, 2022
@fabiensebban fabiensebban deleted the translation-records branch February 9, 2022 17:31
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