mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-25 00:28:20 -05:00
Merge pull request #104 from chrisgarrity/bug/gh102
Localize sample project name
This commit is contained in:
commit
576bf9d0e7
2 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue