From 6e46696d2cb68a29b099610ac580423a6dfb1c96 Mon Sep 17 00:00:00 2001 From: chrisgarrity Date: Tue, 14 Jun 2016 15:43:52 -0400 Subject: [PATCH] Localize sample project name --- src/editor/ScratchJr.js | 5 ++++- src/editor/ui/UI.js | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/editor/ScratchJr.js b/src/editor/ScratchJr.js index edec776..634090f 100644 --- a/src/editor/ScratchJr.js +++ b/src/editor/ScratchJr.js @@ -16,6 +16,7 @@ import ScriptsPane from './ui/ScriptsPane'; import Events from '../utils/Events'; import BlockSpecs from './blocks/BlockSpecs'; import Runtime from './engine/Runtime'; +import Localization from '../utils/Localization'; import {libInit, gn, scaleMultiplier, newHTML, isAndroid, isTablet, getUrlVars, CSSTransition3D, frame} from '../utils/lib'; @@ -362,9 +363,11 @@ export default class ScratchJr { static saveProject (e, onDone) { if (ScratchJr.isEditable() && editmode == 'storyStarter' && storyStarted && !Project.error) { iOS.analyticsEvent('samples', 'story_starter_edited', Project.metadata.name); + // Localize sample project names + var sampleName = Localization.localize('SAMPLE_' + Project.metadata.name); // Get the new project name IO.uniqueProjectName({ - name: Project.metadata.name + name: sampleName }, function (jsonData) { var newName = jsonData.name; Project.metadata.name = newName; diff --git a/src/editor/ui/UI.js b/src/editor/ui/UI.js index 11076d8..bb08f38 100644 --- a/src/editor/ui/UI.js +++ b/src/editor/ui/UI.js @@ -316,8 +316,9 @@ export default class UI { if (ScratchJr.isEditable() && ScratchJr.editmode == 'storyStarter' && !Project.error) { iOS.analyticsEvent('samples', 'story_starter_edited', Project.metadata.name); // Get the new project name + var sampleName = Localization.localize('SAMPLE_' + Project.metadata.name); IO.uniqueProjectName({ - name: Project.metadata.name + name: sampleName }, function (jsonData) { var newName = jsonData.name; Project.metadata.name = newName;