From 1a833f0f4edc410347022100f5f903cd0de1c808 Mon Sep 17 00:00:00 2001 From: ysliu Date: Tue, 13 Sep 2016 17:02:18 +0800 Subject: [PATCH] fix loc strings module name and config to bundle the strings. --- samples/todo-webpart-sample/config/config.json | 5 ++++- .../src/webparts/todo-step-1/TodoWebPart.manifest.json | 2 +- .../src/webparts/todo-step-1/TodoWebPart.ts | 2 +- .../src/webparts/todo-step-1/loc/mystrings.d.ts | 6 +++--- .../src/webparts/todo-step-2/components/Todo.tsx | 2 +- .../src/webparts/todo-step-2/components/TodoForm.tsx | 2 +- .../src/webparts/todo-step-2/components/TodoItem.tsx | 2 +- .../src/webparts/todo-step-2/components/TodoTabs.tsx | 2 +- .../src/webparts/todo-step-2/loc/mystrings.d.ts | 6 +++--- .../src/webparts/todo-step-3/TodoWebPart.tsx | 2 +- .../src/webparts/todo-step-3/components/Todo.tsx | 2 +- .../src/webparts/todo-step-3/components/TodoForm.tsx | 2 +- .../src/webparts/todo-step-3/components/TodoItem.tsx | 2 +- .../src/webparts/todo-step-3/components/TodoTabs.tsx | 2 +- .../webparts/todo-step-3/dataProviders/TodoDataProvider.ts | 2 +- .../src/webparts/todo-step-3/loc/mystrings.d.ts | 6 +++--- .../src/webparts/todo-step-4/TodoWebPart.tsx | 2 +- .../src/webparts/todo-step-4/components/Todo.tsx | 2 +- .../src/webparts/todo-step-4/components/TodoForm.tsx | 2 +- .../src/webparts/todo-step-4/components/TodoItem.tsx | 2 +- .../src/webparts/todo-step-4/components/TodoTabs.tsx | 2 +- .../webparts/todo-step-4/dataProviders/TodoDataProvider.ts | 2 +- .../src/webparts/todo-step-4/loc/mystrings.d.ts | 6 +++--- 23 files changed, 34 insertions(+), 31 deletions(-) diff --git a/samples/todo-webpart-sample/config/config.json b/samples/todo-webpart-sample/config/config.json index a49d571f2..8ea7ab6ab 100644 --- a/samples/todo-webpart-sample/config/config.json +++ b/samples/todo-webpart-sample/config/config.json @@ -31,6 +31,9 @@ "react-dom/server": "node_modules/react-dom/dist/react-dom-server.min.js" }, "localizedResources": { - "helloWorldStrings": "webparts/helloWorld/loc/{locale}.js" + "todoStep1Strings": "webparts/todo-step-1/loc/{locale}.js", + "todoStep2Strings": "webparts/todo-step-2/loc/{locale}.js", + "todoStep3Strings": "webparts/todo-step-3/loc/{locale}.js", + "todoStep4Strings": "webparts/todo-step-4/loc/{locale}.js" } } diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-1/TodoWebPart.manifest.json b/samples/todo-webpart-sample/src/webparts/todo-step-1/TodoWebPart.manifest.json index c55831f4d..3fc9d8345 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-1/TodoWebPart.manifest.json +++ b/samples/todo-webpart-sample/src/webparts/todo-step-1/TodoWebPart.manifest.json @@ -11,7 +11,7 @@ "group": { "default": "Under Development" }, "title": { "default": "Todo step 1" }, "description": { "default": "Todo sample webpart step 1" }, - "officeFabricIconFontName": "Page", + "officeFabricIconFontName": "BulletedList", "properties": { "description": "Todo" } diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-1/TodoWebPart.ts b/samples/todo-webpart-sample/src/webparts/todo-step-1/TodoWebPart.ts index 035d16c4a..70a06786b 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-1/TodoWebPart.ts +++ b/samples/todo-webpart-sample/src/webparts/todo-step-1/TodoWebPart.ts @@ -6,7 +6,7 @@ import { PropertyPaneTextField } from '@microsoft/sp-client-preview'; -import * as strings from 'todoStrings'; +import * as strings from 'todoStep1Strings'; import Todo, { ITodoProps } from './components/Todo'; import { ITodoWebPartProps } from './ITodoWebPartProps'; diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-1/loc/mystrings.d.ts b/samples/todo-webpart-sample/src/webparts/todo-step-1/loc/mystrings.d.ts index 5b94b8d6f..37eb14ed3 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-1/loc/mystrings.d.ts +++ b/samples/todo-webpart-sample/src/webparts/todo-step-1/loc/mystrings.d.ts @@ -1,10 +1,10 @@ -declare interface ITodoStrings { +declare interface ITodoStep1Strings { PropertyPaneDescription: string; BasicGroupName: string; DescriptionFieldLabel: string; } -declare module 'todoStrings' { - const strings: ITodoStrings; +declare module 'todoStep1Strings' { + const strings: ITodoStep1Strings; export = strings; } diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-2/components/Todo.tsx b/samples/todo-webpart-sample/src/webparts/todo-step-2/components/Todo.tsx index 701d6ae23..18ae7e063 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-2/components/Todo.tsx +++ b/samples/todo-webpart-sample/src/webparts/todo-step-2/components/Todo.tsx @@ -21,7 +21,7 @@ import { import TodoForm from './TodoForm'; import TodoTabs from './TodoTabs'; -import * as strings from 'todoStrings'; +import * as strings from 'todoStep2Strings'; import styles from '../style/Todo.module.scss'; /** diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-2/components/TodoForm.tsx b/samples/todo-webpart-sample/src/webparts/todo-step-2/components/TodoForm.tsx index 8ea8167b1..46ba57e61 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-2/components/TodoForm.tsx +++ b/samples/todo-webpart-sample/src/webparts/todo-step-2/components/TodoForm.tsx @@ -16,7 +16,7 @@ import { ITodoTask, ItemOperationCallback } from '../ITodoWebPartProps'; -import * as strings from 'todoStrings'; +import * as strings from 'todoStep2Strings'; import styles from '../style/Todo.module.scss'; /** diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-2/components/TodoItem.tsx b/samples/todo-webpart-sample/src/webparts/todo-step-2/components/TodoItem.tsx index 30ec05de6..cf6b0b820 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-2/components/TodoItem.tsx +++ b/samples/todo-webpart-sample/src/webparts/todo-step-2/components/TodoItem.tsx @@ -24,7 +24,7 @@ import { ItemOperationCallback } from '../ITodoWebPartProps'; -import * as strings from 'todoStrings'; +import * as strings from 'todoStep2Strings'; import styles from '../style/Todo.module.scss'; /** diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-2/components/TodoTabs.tsx b/samples/todo-webpart-sample/src/webparts/todo-step-2/components/TodoTabs.tsx index 5ebde6eae..063f4a6b4 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-2/components/TodoTabs.tsx +++ b/samples/todo-webpart-sample/src/webparts/todo-step-2/components/TodoTabs.tsx @@ -23,7 +23,7 @@ import { import TodoList from './TodoList'; -import * as strings from 'todoStrings'; +import * as strings from 'todoStep2Strings'; import styles from '../style/Todo.module.scss'; /** diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-2/loc/mystrings.d.ts b/samples/todo-webpart-sample/src/webparts/todo-step-2/loc/mystrings.d.ts index f0ccc71d8..942956b7d 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-2/loc/mystrings.d.ts +++ b/samples/todo-webpart-sample/src/webparts/todo-step-2/loc/mystrings.d.ts @@ -1,4 +1,4 @@ -declare interface ITodoStrings { +declare interface ITodoStep2Strings { TodoListTitle: string; TodoListTabNameAllTasks: string; TodoListTabNameCompleted: string; @@ -33,7 +33,7 @@ declare interface ITodoStrings { TitleEmptyErrorMessage: string; } -declare module 'todoStrings' { - const strings: ITodoStrings; +declare module 'todoStep2Strings' { + const strings: ITodoStep2Strings; export = strings; } diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-3/TodoWebPart.tsx b/samples/todo-webpart-sample/src/webparts/todo-step-3/TodoWebPart.tsx index e9dd6a672..3413ce750 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-3/TodoWebPart.tsx +++ b/samples/todo-webpart-sample/src/webparts/todo-step-3/TodoWebPart.tsx @@ -39,7 +39,7 @@ import { } from './ITodoWebPartProps'; import Todo, { ITodoProps } from './components/Todo'; -import * as strings from 'todoStrings'; +import * as strings from 'todoStep3Strings'; import styles from './style/Todo.module.scss'; /** diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-3/components/Todo.tsx b/samples/todo-webpart-sample/src/webparts/todo-step-3/components/Todo.tsx index 701d6ae23..19236d042 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-3/components/Todo.tsx +++ b/samples/todo-webpart-sample/src/webparts/todo-step-3/components/Todo.tsx @@ -21,7 +21,7 @@ import { import TodoForm from './TodoForm'; import TodoTabs from './TodoTabs'; -import * as strings from 'todoStrings'; +import * as strings from 'todoStep3Strings'; import styles from '../style/Todo.module.scss'; /** diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-3/components/TodoForm.tsx b/samples/todo-webpart-sample/src/webparts/todo-step-3/components/TodoForm.tsx index 8ea8167b1..a1402a34e 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-3/components/TodoForm.tsx +++ b/samples/todo-webpart-sample/src/webparts/todo-step-3/components/TodoForm.tsx @@ -16,7 +16,7 @@ import { ITodoTask, ItemOperationCallback } from '../ITodoWebPartProps'; -import * as strings from 'todoStrings'; +import * as strings from 'todoStep3Strings'; import styles from '../style/Todo.module.scss'; /** diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-3/components/TodoItem.tsx b/samples/todo-webpart-sample/src/webparts/todo-step-3/components/TodoItem.tsx index 30ec05de6..d4e0c6653 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-3/components/TodoItem.tsx +++ b/samples/todo-webpart-sample/src/webparts/todo-step-3/components/TodoItem.tsx @@ -24,7 +24,7 @@ import { ItemOperationCallback } from '../ITodoWebPartProps'; -import * as strings from 'todoStrings'; +import * as strings from 'todoStep3Strings'; import styles from '../style/Todo.module.scss'; /** diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-3/components/TodoTabs.tsx b/samples/todo-webpart-sample/src/webparts/todo-step-3/components/TodoTabs.tsx index 5ebde6eae..ffb642596 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-3/components/TodoTabs.tsx +++ b/samples/todo-webpart-sample/src/webparts/todo-step-3/components/TodoTabs.tsx @@ -23,7 +23,7 @@ import { import TodoList from './TodoList'; -import * as strings from 'todoStrings'; +import * as strings from 'todoStep3Strings'; import styles from '../style/Todo.module.scss'; /** diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-3/dataProviders/TodoDataProvider.ts b/samples/todo-webpart-sample/src/webparts/todo-step-3/dataProviders/TodoDataProvider.ts index 13cde50e9..da446669a 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-3/dataProviders/TodoDataProvider.ts +++ b/samples/todo-webpart-sample/src/webparts/todo-step-3/dataProviders/TodoDataProvider.ts @@ -14,7 +14,7 @@ import { ITodoTaskList } from '../ITodoWebPartProps'; -import * as strings from 'todoStrings'; +import * as strings from 'todoStep3Strings'; /** * TodoDataProvider interact with current sharepoint site to accomplish diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-3/loc/mystrings.d.ts b/samples/todo-webpart-sample/src/webparts/todo-step-3/loc/mystrings.d.ts index f0ccc71d8..daef48c0f 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-3/loc/mystrings.d.ts +++ b/samples/todo-webpart-sample/src/webparts/todo-step-3/loc/mystrings.d.ts @@ -1,4 +1,4 @@ -declare interface ITodoStrings { +declare interface ITodoStep3Strings { TodoListTitle: string; TodoListTabNameAllTasks: string; TodoListTabNameCompleted: string; @@ -33,7 +33,7 @@ declare interface ITodoStrings { TitleEmptyErrorMessage: string; } -declare module 'todoStrings' { - const strings: ITodoStrings; +declare module 'todoStep3Strings' { + const strings: ITodoStep3Strings; export = strings; } diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-4/TodoWebPart.tsx b/samples/todo-webpart-sample/src/webparts/todo-step-4/TodoWebPart.tsx index e9dd6a672..45fcf3b4d 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-4/TodoWebPart.tsx +++ b/samples/todo-webpart-sample/src/webparts/todo-step-4/TodoWebPart.tsx @@ -39,7 +39,7 @@ import { } from './ITodoWebPartProps'; import Todo, { ITodoProps } from './components/Todo'; -import * as strings from 'todoStrings'; +import * as strings from 'todoStep4Strings'; import styles from './style/Todo.module.scss'; /** diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-4/components/Todo.tsx b/samples/todo-webpart-sample/src/webparts/todo-step-4/components/Todo.tsx index 701d6ae23..30d6802e4 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-4/components/Todo.tsx +++ b/samples/todo-webpart-sample/src/webparts/todo-step-4/components/Todo.tsx @@ -21,7 +21,7 @@ import { import TodoForm from './TodoForm'; import TodoTabs from './TodoTabs'; -import * as strings from 'todoStrings'; +import * as strings from 'todoStep4Strings'; import styles from '../style/Todo.module.scss'; /** diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-4/components/TodoForm.tsx b/samples/todo-webpart-sample/src/webparts/todo-step-4/components/TodoForm.tsx index 8ea8167b1..1f5efdfdf 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-4/components/TodoForm.tsx +++ b/samples/todo-webpart-sample/src/webparts/todo-step-4/components/TodoForm.tsx @@ -16,7 +16,7 @@ import { ITodoTask, ItemOperationCallback } from '../ITodoWebPartProps'; -import * as strings from 'todoStrings'; +import * as strings from 'todoStep4Strings'; import styles from '../style/Todo.module.scss'; /** diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-4/components/TodoItem.tsx b/samples/todo-webpart-sample/src/webparts/todo-step-4/components/TodoItem.tsx index 30ec05de6..b54a35853 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-4/components/TodoItem.tsx +++ b/samples/todo-webpart-sample/src/webparts/todo-step-4/components/TodoItem.tsx @@ -24,7 +24,7 @@ import { ItemOperationCallback } from '../ITodoWebPartProps'; -import * as strings from 'todoStrings'; +import * as strings from 'todoStep4Strings'; import styles from '../style/Todo.module.scss'; /** diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-4/components/TodoTabs.tsx b/samples/todo-webpart-sample/src/webparts/todo-step-4/components/TodoTabs.tsx index 5ebde6eae..0ab746a00 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-4/components/TodoTabs.tsx +++ b/samples/todo-webpart-sample/src/webparts/todo-step-4/components/TodoTabs.tsx @@ -23,7 +23,7 @@ import { import TodoList from './TodoList'; -import * as strings from 'todoStrings'; +import * as strings from 'todoStep4Strings'; import styles from '../style/Todo.module.scss'; /** diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-4/dataProviders/TodoDataProvider.ts b/samples/todo-webpart-sample/src/webparts/todo-step-4/dataProviders/TodoDataProvider.ts index 13cde50e9..f0ad37238 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-4/dataProviders/TodoDataProvider.ts +++ b/samples/todo-webpart-sample/src/webparts/todo-step-4/dataProviders/TodoDataProvider.ts @@ -14,7 +14,7 @@ import { ITodoTaskList } from '../ITodoWebPartProps'; -import * as strings from 'todoStrings'; +import * as strings from 'todoStep4Strings'; /** * TodoDataProvider interact with current sharepoint site to accomplish diff --git a/samples/todo-webpart-sample/src/webparts/todo-step-4/loc/mystrings.d.ts b/samples/todo-webpart-sample/src/webparts/todo-step-4/loc/mystrings.d.ts index f0ccc71d8..084be3e3c 100644 --- a/samples/todo-webpart-sample/src/webparts/todo-step-4/loc/mystrings.d.ts +++ b/samples/todo-webpart-sample/src/webparts/todo-step-4/loc/mystrings.d.ts @@ -1,4 +1,4 @@ -declare interface ITodoStrings { +declare interface ITodoStep4Strings { TodoListTitle: string; TodoListTabNameAllTasks: string; TodoListTabNameCompleted: string; @@ -33,7 +33,7 @@ declare interface ITodoStrings { TitleEmptyErrorMessage: string; } -declare module 'todoStrings' { - const strings: ITodoStrings; +declare module 'todoStep4Strings' { + const strings: ITodoStep4Strings; export = strings; }