Skip to content
Merged
3 changes: 2 additions & 1 deletion documentation/codegenerator/client/codegenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { Session } from 'meteor/session';

import _ from 'lodash';

import { DocumentationFiles, languageHashName } from '/documentation/collection/collection';
import { DocumentationFiles } from '/documentation/collection/collection';
import { languageHashName } from './hashName'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@brylie File codegenerator.js
If I do import the variables 'LanguagesList' and 'LanguageParams' from collection.js, this variables wil be undefined.

Template.sdkCodeGeneratorModal.onCreated(function () {
const instance = this;
Expand Down
17 changes: 17 additions & 0 deletions documentation/codegenerator/client/hashName.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// The most part of list items can convert to user friendly name by standard method
// The method is to replace dash on space and to do the capital letter of each word
// Some language names can't be convert by standard method.
// Variable 'languageHashName' keeps specific names
const languageHashName = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Keep this in the same file as the language names. E.g. codegenerator_languages.js

'dynamic-html': 'Dynamic HTML',
'csharp': 'C#',
'CsharpDotNet2': 'C# .NET 2.0',
'html': 'HTML',
'objc': 'Objective-C',
'php': 'PHP',
'qt5cpp': 'Qt 5 C++',
'swagger': 'Swagger JSON',
'swagger-yaml': 'Swagger YAML'
};

export { languageHashName }
18 changes: 1 addition & 17 deletions documentation/collection/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,5 @@ const DocumentationFiles = new FileCollection('DocumentationFiles', {
]
});

// The most part of list items can convert to user friendly name by standard method
// The method is to replace dash on space and to do the capital letter of each word
// Some language names can't be convert by standard method.
// Variable 'languageHashName' keeps specific names
const languageHashName = {
'dynamic-html': 'Dynamic HTML',
'csharp': 'C#',
'CsharpDotNet2': 'C# .NET 2.0',
'html': 'HTML',
'objc': 'Objective-C',
'php': 'PHP',
'qt5cpp': 'Qt 5 C++',
'swagger': 'Swagger JSON',
'swagger-yaml': 'Swagger YAML'
};

export { DocumentationFiles, languageHashName };
export { DocumentationFiles };