Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Provide i18n for InlineBezierCurveEditor #5553

Merged
merged 4 commits into from
Oct 18, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/extensions/default/InlineBezierCurveEditor/Localized.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.bezier-curve-editor .coordinate-plane:after {
content: '{{INLINE_BEZIER_EDITOR_TIME}}';
}

.bezier-curve-editor .coordinate-plane:hover:before {
content: '{{INLINE_BEZIER_EDITOR_PROGRESSION}} (' attr(data-progression) '%)';
}

.bezier-curve-editor .coordinate-plane:before {
content: '{{INLINE_BEZIER_EDITOR_PROGRESSION}}';
}

.bezier-curve-editor .coordinate-plane:hover:after {
content: '{{INLINE_BEZIER_EDITOR_TIME}} (' attr(data-time) '%)';
}
10 changes: 0 additions & 10 deletions src/extensions/default/InlineBezierCurveEditor/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@

.bezier-curve-editor .coordinate-plane:before {
border-bottom: 1px solid transparent;
content: 'Progression';
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
Expand All @@ -89,19 +88,10 @@
}

.bezier-curve-editor .coordinate-plane:after {
content: 'Time';
margin-bottom: -1.5em;
white-space: nowrap;
}

.bezier-curve-editor .coordinate-plane:hover:before {
content: 'Progression (' attr(data-progression) '%)';
}

.bezier-curve-editor .coordinate-plane:hover:after {
content: 'Time (' attr(data-time) '%)';
}

.bezier-curve-editor .control-point {
background: -webkit-linear-gradient(270deg, rgb(249, 249, 249) 50%, rgb(237, 237, 237) 50%);
position: absolute;
Expand Down
7 changes: 5 additions & 2 deletions src/extensions/default/InlineBezierCurveEditor/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,19 @@
*/

/*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */
/*global define, brackets, $, window */
/*global define, brackets, $, window, Mustache */

define(function (require, exports, module) {
"use strict";

// Brackets modules
var EditorManager = brackets.getModule("editor/EditorManager"),
ExtensionUtils = brackets.getModule("utils/ExtensionUtils"),
Strings = brackets.getModule("strings"),

InlineBezierCurveEditor = require("InlineBezierCurveEditor").InlineBezierCurveEditor,
BezierCurveUtils = require("BezierCurveUtils");
BezierCurveUtils = require("BezierCurveUtils"),
Localized = require("text!Localized.css");


// Functions
Expand Down Expand Up @@ -152,6 +154,7 @@ define(function (require, exports, module) {
function init() {
// Load our stylesheet
ExtensionUtils.loadStyleSheet(module, "main.css");
ExtensionUtils.addEmbeddedStyleSheet(Mustache.render(Localized, Strings));

EditorManager.registerInlineEditProvider(inlineBezierCurveEditorProvider);
}
Expand Down
4 changes: 4 additions & 0 deletions src/nls/de/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,10 @@ define({
"LOCALE_ZH_CN" : "Chinesisch, vereinfacht",
"LOCALE_HU" : "Ungarisch",

// extensions/default/InlineBezierCurveEditor
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make more sense to move extension-specific strings to each extension?

Eventually, the Extension Manager will have the capability to enable/disable extensions (and I think this should apply to extensions in the default folder as well), so strings for disabled extensions will not get loaded. But, maybe the amount of memory saved is not worth the overhead.

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 don't really know, but this would be some work as we had to add an nls folder with some subfolders and strings.js (twice, one in root and one in nls). So it maybe would save some memory, but it may also affect the loading performance (more files must be read from disk) and the size of an installed Brackets version.

But we don't need that now cause there aren't any memory problems (systems have much RAM by default).
And also every extensions uses these files for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that it's OK for now, but I just wanted to mention it.

"INLINE_BEZIER_EDITOR_TIME" : "Zeit",
"INLINE_BEZIER_EDITOR_PROGRESSION" : "Verlauf",

// extensions/default/InlineColorEditor
"COLOR_EDITOR_CURRENT_COLOR_SWATCH_TIP" : "Aktuelle Farbe",
"COLOR_EDITOR_ORIGINAL_COLOR_SWATCH_TIP" : "Original-Farbe",
Expand Down
4 changes: 4 additions & 0 deletions src/nls/root/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,10 @@ define({
"LOCALE_ZH_CN" : "Chinese, simplified",
"LOCALE_HU" : "Hungarian",

// extensions/default/InlineBezierCurveEditor
"INLINE_BEZIER_EDITOR_TIME" : "Time",
"INLINE_BEZIER_EDITOR_PROGRESSION" : "Progression",

// extensions/default/InlineColorEditor
"COLOR_EDITOR_CURRENT_COLOR_SWATCH_TIP" : "Current Color",
"COLOR_EDITOR_ORIGINAL_COLOR_SWATCH_TIP" : "Original Color",
Expand Down