Skip to content

Commit

Permalink
Merge pull request #638 from codeforjapan/development
Browse files Browse the repository at this point in the history
Release 1.2.0
  • Loading branch information
MaySoMusician authored May 27, 2021
2 parents bbc08e1 + 2ecb181 commit f75a64d
Show file tree
Hide file tree
Showing 11 changed files with 141 additions and 67 deletions.
1 change: 1 addition & 0 deletions nuxt-i18n.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const defaultLocale = 'ja'

const options = {
strategy: 'prefix_except_default',
seo: false,
detectBrowserLanguage: false,
defaultLocale,
vueI18n: {
Expand Down
49 changes: 1 addition & 48 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,63 +14,16 @@ export default {
htmlAttrs: {
prefix: 'og: http://ogp.me/ns#',
},
title: 'おうちで時間割',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{
hid: 'keyword',
name: 'keyword',
content: 'CodeforJapan, おうちで時間割, デジタル, 学び, 今後の学習',
},
{
hid: 'author',
name: 'author',
content: 'Code for Japan',
},
{
hid: 'og:site_name',
property: 'og:site_name',
content: 'おうちで時間割',
},
{
hid: 'og:url',
property: 'og:url',
content: `https://app.studyathome.jp/`,
},
{
hid: 'og:title',
property: 'og:title',
content: 'おうちで時間割',
},
{
hid: 'og:description',
property: 'og:description',
content:
'子どもの学びにデジタルの活用を - 臨時休校期間と今後の学習に向けて 簡単に楽しく学べる環境を今だから、みんなでつくろう。',
},
{
hid: 'apple-mobile-web-app-title',
name: 'apple-mobile-web-app-title',
content: 'おうちで時間割',
},
{
hid: 'description',
name: 'description',
content:
'子どもの学びにデジタルの活用を - 臨時休校期間と今後の学習に向けて 簡単に楽しく学べる環境を今だから、みんなでつくろう。',
},
{ hid: 'og:type', property: 'og:type', content: 'website' },
{
hid: 'og:image',
property: 'og:image',
content: 'https://app.studyathome.jp/ogp.png',
},
{
hid: 'twitter:image',
name: 'twitter:image',
content: 'https://app.studyathome.jp/ogp.png',
},
{ name: 'twitter:card', content: 'summary_large_image' },
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
Expand Down
50 changes: 42 additions & 8 deletions src/assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@
"login": "Sign In",
"logout": "Sign Out",
"ok": "OK",
"save": "Save"
"save": "Save",
"change": "Modify",
"verify": "Verification"
},
"error": {
"default": "An error occurred, please try again later."
}
},
"calender": {
"prev_week": "Previous week",
"next_week": "Next week",
"to_today": "Move to today"
},
"footer": {
"about": "About StayAtHome",
"contact": "Contact Us",
Expand All @@ -40,7 +47,8 @@
"password": "Password",
"password_rules": "Password Must be At Least 6 Characters",
"password_not_acceptable": "The Password Does Not Meet the Password Requirements",
"password_not_same": "Inconsistent Passwords"
"password_not_same": "Inconsistent Passwords",
"verification_code":"Verification code"
}
},
"agree_terms": {
Expand Down Expand Up @@ -69,15 +77,15 @@
"date": "Date Setting",
"time": "Time Setting",
"subject_label_color": "Label Color",
"video_keyword": "(Optional function) Video Search",
"video_keyword": "Optional feature: Video search of {source}",
"video_url": "Reference Video URL",
"video_thumbnail": "Video Thumbnail/Caption Display",
"textbook_page": "Textbook Page",
"material_title": "Learning Material Title",
"material_url": "Learning Material URL"
},
"placeholder": {
"video_keyword": "EX) Science"
"video_keyword": "Keyword"
},
"required": "*Items Marked with Are Required",
"search_videos": {
Expand Down Expand Up @@ -134,7 +142,9 @@
"label": "To the Teacher Who Made the Timetable",
"buttons": {
"signup": "Register As A User",
"login": "Log In"
"login": "Log In",
"registerLessons": "Create Timetable",
"logout": "Sign Out"
}
}
},
Expand All @@ -145,10 +155,28 @@
"no_classes": "There Are No Editable Courses. Please Register Your Course."
},
"user_edit_user_data": {
"title": "Change User Information",
"title": "Change User Information"
},
"user_edit_user_name": {
"title": "Change name (display name)",
"labels": {
"current_nickname": "Current name (display name)",
"new_nickname": "Name to be used (display name)"
}
},
"user_edit_user_email": {
"title": "Change email address",
"labels": {
"new_password": "Change Password",
"new_password_confirm": "Change Password (for confirmation)"
"current_email": "Current email address",
"new_email": "Email address to be used"
}
},
"user_edit_user_password": {
"title": "Change password",
"labels": {
"current_password": "Please enter your current password",
"new_password": "New password",
"new_password_confirm": "Password (for confirmation)"
}
},
"user_login": {
Expand Down Expand Up @@ -192,6 +220,12 @@
"go_back_to_top": "Back to Top",
"message": "A Confirmation Email Has Been Sent to the Email Address You Entered. Please Authenticate from the URL Described in the Email."
}
},
"user_verify": {
"title": "Confirm email address"
},
"user_verify_new_email": {
"title": "Confirm changing email address"
}
}
}
2 changes: 2 additions & 0 deletions src/assets/locales/ja.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"title": "おうちで時間割",
"description": "子どもの学びにデジタルの活用を - 臨時休校期間と今後の学習に向けて 簡単に楽しく学べる環境を今だから、みんなでつくろう。",
"common": {
"general": {
"buttons": {
Expand Down
4 changes: 3 additions & 1 deletion src/assets/locales/zh_TW.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"title": "在家學習時間表",
"description": "「在家學習時間表」是你的數位學習好夥伴!我們創造了線上學習環境,讓你在家也可以輕鬆的上線學習,不管是老師或學生,歡迎一起來發掘更多上課的樂趣!",
"common": {
"general": {
"buttons": {
Expand Down Expand Up @@ -77,7 +79,7 @@
"date": "設定日期",
"time": "設定時間",
"subject_label_color": "標籤顏色",
"video_keyword": "可選功能:搜尋參考影片",
"video_keyword": "可選功能:{source}的影片搜尋",
"video_url": "參考影片 URL",
"video_thumbnail": "顯示影片縮圖",
"textbook_page": "教科書頁",
Expand Down
67 changes: 66 additions & 1 deletion src/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,73 @@ export default Vue.extend({
loading: true,
}
},
head() {
const ogpImage = () => {
switch (this.$i18n.locale) {
case 'zh-tw':
return `https://app.studyathome.jp/ogp-${this.$i18n.locale}.png`
default:
return 'https://app.studyathome.jp/ogp.png'
}
}
return {
title: this.$tc('title'),
meta: [
{
hid: 'description',
name: 'description',
content: this.$tc('description'),
},
{
hid: 'apple-mobile-web-app-title',
name: 'apple-mobile-web-app-title',
content: this.$tc('title'),
},
{
hid: 'og:title',
property: 'og:title',
content: this.$tc('title'),
},
{
hid: 'og:description',
property: 'og:description',
content: this.$tc('description'),
},
{
hid: 'og:site_name',
property: 'og:site_name',
content: this.$tc('title'),
},
{
hid: 'og:image',
property: 'og:image',
content: ogpImage(),
},
{
hid: 'og:image:width',
property: 'og:image:width',
content: '1200',
},
{
hid: 'og:image:height',
property: 'og:image:height',
content: '630',
},
{
hid: 'twitter:image',
name: 'twitter:image',
content: ogpImage(),
},
{
hid: 'og:url',
property: 'og:url',
content: `https://app.studyathome.jp${this.$route.path}`,
},
],
}
},
mounted(): void {
this.loading = false
;(this as any).loading = false
},
})
</script>
Expand Down
11 changes: 6 additions & 5 deletions src/pages/terms.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
<li>
本サービスでは、HTML5及びJavaScript、CSS3、SVGを使用するものとします。なお、以下の推奨ブラウザをご利用の場合、ブラウザの設定でこれら機能を有効にしておくことで、最善のレイアウトで本サイトを閲覧することができます。
<ul>
<li>Windows Google Chrome、Firefox (各ブラウザ最新版)</li>
<li>Mac OS Google Chrome、Safari、Firefox (各ブラウザ最新版)</li>
<li>iOS(iPhone、iPad) Mobile Safari(OSバージョン 8.4以降)</li>
<li>Android Chrome Browser(OSバージョン 4.2.2以降)</li>
<li>Windows Google Chrome、Firefox、Opera (各ブラウザ最新版)</li>
<li>macOS Google Chrome、Safari、Firefox (各ブラウザ最新版)</li>
<li>iOS(iPhone、iPad) Safari(OSバージョン 12.0以降)</li>
<li>iPadOS Safari(OSバージョン 13.0以降)</li>
<li>Android Chrome(OSバージョン 6.0以降)</li>
</ul>
</li>
</ol>
Expand All @@ -43,7 +44,7 @@
「弊団体」とは、一般社団法人コード・フォー・ジャパンを意味します。
</li>
<li>
「弊団体ウェブサイト」とは、そのドメインが「code4japan.org」である、弊団体が運営するウェブサイト(理由の如何を問わず、弊団体のウェブサイトのドメインまたは内容が変更された場合は、当該変更後のウェブサイトを含みます。)を意味します。
「弊団体ウェブサイト」とは、そのドメインが「code4japan.org」もしくは「studyathome.jp」である、弊団体が運営するウェブサイト(理由の如何を問わず、弊団体のウェブサイトのドメインまたは内容が変更された場合は、当該変更後のウェブサイトを含みます。)を意味します。
</li>
<li>
「登録ユーザー」とは、第3条(登録)に基づいて本サービスの利用者としての登録がなされたユーザーを意味します。
Expand Down
1 change: 1 addition & 0 deletions src/pages/user/registerClass.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export default Vue.extend({
.registerClass({
schoolName: this.schoolName,
className: this.className,
locale: this.$i18n.locale,
})
.then(() => {
this.loading = false
Expand Down
Binary file added src/static/ogp-zh-tw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/static/ogp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 19 additions & 4 deletions src/store/modules/classData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,22 @@ const VuexModule = createModule({
target: 'nuxt',
})

const generateUniqueId = (): string => {
const c =
'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん'
const generateUniqueId = (locale: string): string => {
let c: string = ''
switch (locale) {
case 'ja':
c =
'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん'
break
case 'en':
c = 'abcdefghijklmnopqrstuvwxyz'
break
case 'zh-tw':
c =
'ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄧㄨㄩㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦ'
break
}

const cl = c.length
const result =
c[Math.floor(Math.random() * cl)] +
Expand Down Expand Up @@ -237,17 +250,19 @@ export class ClassDataStore extends VuexModule implements classData.ClassData {
public async registerClass({
className,
schoolName,
locale,
}: {
className: string
schoolName: string
locale: string
}) {
if (!vxm.user.isAuthenticated) {
throw new Error('ユーザーが正しくログインされていません')
}

let classId, classObject
do {
classId = generateUniqueId()
classId = generateUniqueId(locale)
try {
const result = (await API.graphql({
query: getClassSimple,
Expand Down

0 comments on commit f75a64d

Please sign in to comment.