Browse Source

Fixed some stuff, it actually works now.

master
Gogs 3 years ago
parent
commit
4dadd6e703
2 changed files with 356 additions and 280 deletions
  1. 0
    280
      translate.js
  2. 356
    0
      translate.user.js

+ 0
- 280
translate.js View File

@@ -1,280 +0,0 @@
// ==UserScript==
// @name piapro.jp translation
// @namespace 0xf00fc7c8
// @include http://piapro.jp/
// @version 1
// @grant none
// ==/UserScript==
(function() {
var _ = (function(x) { //stub function
return x
})

/* Front page */
/** Top toolbar */
/*** First dropdown */
document.querySelector("#_gnav_cont > a:nth-child(1)") = _("投稿作品") + "▼"
document.querySelector("#_header_pmenu_cont > li:nth-child(1) > a:nth-child(1)").innerText = _("オンガク一覧")
document.querySelector(
"#_header_pmenu_cont > li:nth-child(2) > a:nth-child(1)"
).innerText = _("イラスト一覧")
document.querySelector("#_header_pmenu_cont > li:nth-child(3) > a:nth-child(1)").innerText = _("テキスト一覧")
document.querySelector(
"#_header_pmenu_cont > li:nth-child(4) > a:nth-child(1)"
).innerText = _("3Dモデル一覧")
/*** Second dropdown */
document.querySelector(
"#_gnav_collabo > a:nth-child(1)"
).innerText = _("コラボ") + "▼"
document.querySelector(
"#_header_pmenu_collabo > li:nth-child(1) > a:nth-child(1)"
).innerText = _("みんなでコラボ")
document.querySelector(
"#_header_pmenu_collabo > li:nth-child(2) > a:nth-child(1)"
).innerText = _("公式コラボ")

/*** Third */
document.querySelector(
"li.gnav:nth-child(4) > a:nth-child(1)"
).innerText = _("新規投稿")

/*** Fourth */
document.querySelector(
"li.gnav:nth-child(5) > a:nth-child(1)"
).innerText = _("ブログ")

/*** Second from right */
document.querySelector(
".button_normal"
).innerText = _("新規登録|ログイン")

/*** Dropdown on right */
document.querySelector(
"#_btn_menu_info"
).innerText = _("ヘルプ") + "▼"
document.querySelector(
"#_header_pmenu_info > li:nth-child(1) > a:nth-child(1)"
).innerText = _("ヘルプ")
document.querySelector(
"#_header_pmenu_info > li:nth-child(2) > a:nth-child(1)"
).innerText _("ピアプロとは?")
document.querySelector(
"#_header_pmenu_info > li:nth-child(3) > a:nth-child(1)"
).innerText = _("ピアプロ関連のTwitter")
document.querySelector(
"#_header_pmenu_info > li:nth-child(4) > a:nth-child(1)"
).innerText = _("キャラクター利用のガイドライン")

/*** Pull down box on left of search field */
document.querySelector(
"div.pick:nth-child(1) > a:nth-child(1)"
).innerText = _("音楽")
document.querySelector(
"div.pick:nth-child(2) > a:nth-child(1)"
).innerText = _("イラスト")
document.querySelector(
"div.pick:nth-child(3) > a:nth-child(1)"
).innerText = _("3Dモデル")
document.querySelector(
"div.pick:nth-child(4) > a:nth-child(1)"
).innerText = _("テキスト")
document.querySelector(
".pulldownbox > div:nth-child(5) > a:nth-child(1)"
).innerText = _("タグ")
document.querySelector(
".pulldownbox > div:nth-child(6) > a:nth-child(1)"
).innerText = _("コラボ")
document.querySelector(
".pulldownbox > div:nth-child(7) > a:nth-child(1)"
).innerText = _("ユーザー")

/*** Pull down box when you click on that arrow on the left of the search field. */
document.querySelector(
"#_from_search_advanced > p:nth-child(3)"
).innerText = _("表示順")
document.querySelector(
"#_from_search_advanced > div:nth-child(4) > label:nth-child(2)"
).innerText = _("投稿された順")
document.querySelector(
"#_from_search_advanced > div:nth-child(4) > label:nth-child(4)"
).innerText = _("みられている順")
document.querySelector(
"html body div#whole div#header.clearfix ul#header_nav.clearfix li div#_search_advanced_box.search_dtl form#_from_search_advanced p"
).innerText = _("表示順")
document.querySelector(
"#_from_search_advanced > label:nth-child(7)"
).innerText = _("ライセンス条件で絞り込む")
/**** the options below show up when a checkbox is checked next to the above */
document.querySelector(
"html body div#whole div#header.clearfix ul#header_nav.clearfix li div#_search_advanced_box.search_dtl form#_from_search_advanced div#_block_search_advanced_license.color_box02 div label"
).innerText = _("ライセンス条件の付いている作品")
document.querySelector(
"#_block_search_advanced_license > div:nth-child(2) > span:nth-child(1)"
).innerText = _("氏名表示")
document.querySelector(
"#_block_search_advanced_license > div:nth-child(2) > label:nth-child(3)"
).innerText = _("あり")
document.querySelector(
"#_block_search_advanced_license > div:nth-child(2) > label:nth-child(5)"
).innerText = _("なし")
document.querySelector(
"#_block_search_advanced_license > div:nth-child(3) > span:nth-child(1)"
).innerText = _("作品改変")
document.querySelector(
"#_block_search_advanced_license > div:nth-child(3) > label:nth-child(3)"
).innerText = _("改変可")
document.querySelector(
"#_block_search_advanced_license > div:nth-child(3) > label:nth-child(5)"
).innerText = _("改変不可")
document.querySelector(
"#_block_search_advanced_license > div:nth-child(4) > label:nth-child(2)"
).innerText = _("ライセンス条件の付いていない作品")
/**** green button */
document.querySelector(
"input.button_bright"
).value = _("検索")

/** Another green button, but overlaid over the image at top this time, with a link underneath it */
document.querySelector(
"a.button_bright"
).innerText = _("新規会員登録")
document.querySelector(
".logout_cts > p:nth-child(2) > a:nth-child(1)"
).innerText = _("ログインはこちらから") + " >>"

document.querySelector(
"html body div#whole div#main div#index_box.clearfix div#index_main div#top_titlebox div ul.main_nav li.now a#_tab_audio"
).innerText = _("オンガク")
document.querySelector(
"#_tab_image"
).innerText = _("イラスト")
document.querySelector(
"html body div#whole div#main div#index_box.clearfix div#index_main div#top_titlebox div ul.main_nav li a#_tab_text"
).innerText = _("テキスト")
document.querySelector(
"#_tab_3dm"
).innerText = _("3Dモデル")
document.querySelector(
"#top_titlebox > div:nth-child(2) > p:nth-child(2) > a:nth-child(1)"
).innerText = _("オンガク作品一覧»")

document.querySelector(
".tag_box > p:nth-child(1)"
).innerText = _("注目のタグ")
document.querySelector(
".taglist > li:nth-child(1) > a:nth-child(1)"
).innerText = _("明るい")
document.querySelector(
".taglist > li:nth-child(2) > a:nth-child(1)"
).innerText = _("シューゲイザー")
document.querySelector(
".taglist > li:nth-child(3) > a:nth-child(1)"
).innerText = _("キラキラ")
document.querySelector(
".taglist > li:nth-child(4) > a:nth-child(1)"
).innerText = _("花")
document.querySelector(
".taglist > li:nth-child(5) > a:nth-child(1)"
).innerText = _("テクノポップ")
document.querySelector(
".taglist > li:nth-child(6) > a:nth-child(1)"
).innerText = _("ハウス")
document.querySelector(
".taglist > li:nth-child(7) > a:nth-child(1)"
).innerText = _("童謡")
document.querySelector(
".tag_box > p:nth-child(2) > a:nth-child(1)"
).innerText = _("タグ一覧") + " »"
document.querySelector(
".taglist > li:nth-child(6) > a:nth-child(1)"
).innerText = _("キラキラ")
document.querySelector(
".taglist > li:nth-child(7) > a:nth-child(1)"
).innerText = _("花")

document.querySelector(
"span.now > a:nth-child(1)"
).innerText = _("全て")
document.querySelector(
".cv_link > span:nth-child(2) > a:nth-child(1)"
).innerText = _("MEIKO")
document.querySelector(
".cv_link > span:nth-child(3) > a:nth-child(1)"
).innerText = _("KAITO")
document.querySelector(
".cv_link > span:nth-child(4) > a:nth-child(1)"
).innerText = _("初音ミク")
document.querySelector(
".cv_link > span:nth-child(5) > a:nth-child(1)"
).innerText = _("鏡音リン")
document.querySelector(
".cv_link > span:nth-child(6) > a:nth-child(1)"
).innerText = _("鏡音レン")
document.querySelector(
".cv_link > span:nth-child(7) > a:nth-child(1)"
).innerText = _("巡音ルカ")
document.querySelector(
".cv_link > span:nth-child(8) > a:nth-child(1)"
).innerText = _("その他")

/** Below a picture of Miku */
document.querySelector(
"div.ifootlink:nth-child(4) > a:nth-child(1)"
).innerText = _("公式コラボ一覧") + " »"

/** Below a different thing on the side */
document.querySelector(
"div.sideinfo:nth-child(4) > div:nth-child(3) > a:nth-child(1)"
).innerText = _("もっとみる") + " »"

/** Below a different thing on the side */
document.querySelector(
"div.sideinfo:nth-child(5) > div:nth-child(3) > a:nth-child(1)"
).innerText = _("初音ミク公式ブログへ") + " »"

/** There's a twitter link on the side for some reason. */
document.querySelector(
".twitter-timeline"
).innerText = _("@piaproさんのツイート")

/** Below the Karent thing */
document.querySelector(
"div.sideinfo:nth-child(7) > div:nth-child(3) > a:nth-child(1)"
).innerText = _("KARENTページへ") + " »"

/** Light Bulb thing? */
document.querySelector(
".color_box01 > a:nth-child(1)"
).innerText = _("お問い合せはこちらから")

/** Grey footer at the bottom */
document.querySelector(
"#footer_menu > a:nth-child(1)"
).innerText = _("ヘルプ")
document.querySelector(
"#footer_menu > a:nth-child(3)"
).innerText = _("サイト動作環境")
document.querySelector(
"#footer_menu > a:nth-child(5)"
).innerText = _("キャラクター利用のガイドライン")
document.querySelector(
"#footer_menu > a:nth-child(7)"
).innerText = _("利用規約")
document.querySelector(
"#footer_menu > a:nth-child(9)"
).innerText = _("プライバシーポリシー")
document.querySelector(
"#footer_menu > a:nth-child(11)"
).innerText = _("お問い合わせ")
document.querySelector(
"#footer_menu > a:nth-child(13)"
).innerText = _("CVシリーズ")
document.querySelector(
"#footer_menu > a:nth-child(15)"
).innerText = _("KARENT")
document.querySelector(
"#footer_menu > a:nth-child(17)"
).innerText = _("ABOUT US")
})()


+ 356
- 0
translate.user.js View File

@@ -0,0 +1,356 @@
// ==UserScript==
// @name piapro.jp translation
// @namespace 0xf00fc7c8
// @include http://piapro.jp/
// @version 1
// @grant none
// @require https://raw.githubusercontent.com/i18next/i18next/master/i18next.min.js
// ==/UserScript==
i18next.init({
lng: 'en',
resources: {
en: {
translation: {
"投稿作品": "View Posts",
"オンガク一覧": "Music",
"イラスト一覧": "Illustrations",
"テキスト一覧": "Text",
"3Dモデル一覧": "3D Models",
"コラボ": "Collaborations",
"みんなでコラボ": "User Collaborations",
"公式コラボ": "Official Collaborations",
"新規投稿": "Submit Post",
"ブログ": "Blog",
"新規登録|ログイン": "Log In / Sign Up",
"ヘルプ": "Help",
"ピアプロとは?": "What is Piapro?",
"ピアプロ関連のTwitter": "Related Twitter",
"キャラクター利用のガイドライン": "Character usage guidelines",
"音楽": "Music",
"イラスト": "Illustrations",
"3Dモデル": "3D Models",
"テキスト": "Text",
"タグ": "Tag",
"ユーザー": "User",
"表示順": "Sort by",
"投稿された順": "Most recent",
"みられている順": "Most viewed",
"ライセンス条件で絞り込む": "Filter by Licence",
"ライセンス条件の付いている作品": "Licence restrictions",
"氏名表示": "Name credit:",
"あり": "Required",
"なし": "Not Required",
"作品改変": "Modification:",
"改変可": "Allowed",
"改変不可": "Forbidden",
"ライセンス条件の付いていない作品": "No licence restrictions",
"検索": "Search",
"新規会員登録": "New member registration",
"ログインはこちらから": "Login from here",
"オンガク": "Music",
"オンガク作品一覧»": "List of music works",
"注目のタグ": "Featured Tag",
"明るい": "Bright",
"シューゲイザー": "Shoegazer",
"キラキラ": "Sparkle",
"花": "Flower",
"テクノポップ": "Technopop",
"ハウス": "House",
"童謡": "Nursery rhymes",
"タグ一覧": "Tags",
"全て": "All",
"MEIKO": "Meiko",
"KAITO": "Kaito",
"初音ミク": "Hatsune Miku",
"鏡音リン": "Kagamine Rin",
"鏡音レン": "Kagamine Len",
"巡音ルカ": "Megurine Luka",
"その他": "Other",
"公式コラボ一覧": "Official Collaborations",
"もっとみる": "See more",
"初音ミク公式ブログへ": "Official Hatsune MIku Blog",
"@piaproさんのツイート": "@piapro Twitter feed",
"KARENTページへ": "KARENT homepage",
"お問い合せはこちらから": "Contact us",
"サイト動作環境": "Website requirements",
"利用規約": "Terms of Service",
"プライバシーポリシー": "Privacy Policy",
"お問い合わせ": "Contact us",
"CVシリーズ": "CV Series",
"KARENT": "KARENT",
"ABOUT US": "About us"
}
}
}
}, (err, t) => {
// initialized and ready to go!
var _ = i18next.t.bind(i18next); hw = 'hello world'

/* Front page */
/** Top toolbar */
/*** First dropdown */
document.querySelector("#_gnav_cont > a:nth-child(1)").innerText = _("投稿作品") + "▼";
document.querySelector("#_header_pmenu_cont > li:nth-child(1) > a:nth-child(1)").innerText = _("オンガク一覧")
document.querySelector(
"#_header_pmenu_cont > li:nth-child(2) > a:nth-child(1)"
).innerText = _("イラスト一覧")
document.querySelector("#_header_pmenu_cont > li:nth-child(3) > a:nth-child(1)").innerText = _("テキスト一覧")
document.querySelector(
"#_header_pmenu_cont > li:nth-child(4) > a:nth-child(1)"
).innerText = _("3Dモデル一覧")
/*** Second dropdown */
document.querySelector(
"#_gnav_collabo > a:nth-child(1)"
).innerText = _("コラボ") + "▼"
document.querySelector(
"#_header_pmenu_collabo > li:nth-child(1) > a:nth-child(1)"
).innerText = _("みんなでコラボ")
document.querySelector(
"#_header_pmenu_collabo > li:nth-child(2) > a:nth-child(1)"
).innerText = _("公式コラボ")

/*** Third */
document.querySelector(
"li.gnav:nth-child(4) > a:nth-child(1)"
).innerText = _("新規投稿")

/*** Fourth */
document.querySelector(
"li.gnav:nth-child(5) > a:nth-child(1)"
).innerText = _("ブログ")

/*** Second from right */
document.querySelector(
".button_normal"
).innerText = _("新規登録|ログイン")

/*** Dropdown on right */
document.querySelector(
"#_btn_menu_info"
).innerText = _("ヘルプ") + "▼"
document.querySelector(
"#_header_pmenu_info > li:nth-child(1) > a:nth-child(1)"
).innerText = _("ヘルプ");
document.querySelector(
"#_header_pmenu_info > li:nth-child(2) > a:nth-child(1)"
).innerText = _("ピアプロとは?");
document.querySelector(
"#_header_pmenu_info > li:nth-child(3) > a:nth-child(1)"
).innerText = _("ピアプロ関連のTwitter")
document.querySelector(
"#_header_pmenu_info > li:nth-child(4) > a:nth-child(1)"
).innerText = _("キャラクター利用のガイドライン")

/*** Pull down box on left of search field */
document.querySelector(
"div.pick:nth-child(1) > a:nth-child(1)"
).innerText = _("音楽")
document.querySelector(
"div.pick:nth-child(2) > a:nth-child(1)"
).innerText = _("イラスト")
document.querySelector(
"div.pick:nth-child(3) > a:nth-child(1)"
).innerText = _("3Dモデル")
document.querySelector(
"div.pick:nth-child(4) > a:nth-child(1)"
).innerText = _("テキスト")
document.querySelector(
".pulldownbox > div:nth-child(5) > a:nth-child(1)"
).innerText = _("タグ")
document.querySelector(
".pulldownbox > div:nth-child(6) > a:nth-child(1)"
).innerText = _("コラボ")
document.querySelector(
".pulldownbox > div:nth-child(7) > a:nth-child(1)"
).innerText = _("ユーザー")

/*** Pull down box when you click on that arrow on the left of the search field. */
document.querySelector(
"#_from_search_advanced > p:nth-child(3)"
).innerText = _("表示順")
document.querySelector(
"#_from_search_advanced > div:nth-child(4) > label:nth-child(2)"
).innerText = _("投稿された順")
document.querySelector(
"#_from_search_advanced > div:nth-child(4) > label:nth-child(4)"
).innerText = _("みられている順")
document.querySelector(
"html body div#whole div#header.clearfix ul#header_nav.clearfix li div#_search_advanced_box.search_dtl form#_from_search_advanced p"
).innerText = _("表示順")
document.querySelector(
"#_from_search_advanced > label:nth-child(7)"
).innerText = _("ライセンス条件で絞り込む")
/**** the options below show up when a checkbox is checked next to the above */
document.querySelector(
"html body div#whole div#header.clearfix ul#header_nav.clearfix li div#_search_advanced_box.search_dtl form#_from_search_advanced div#_block_search_advanced_license.color_box02 div label"
).innerText = _("ライセンス条件の付いている作品")
document.querySelector(
"#_block_search_advanced_license > div:nth-child(2) > span:nth-child(1)"
).innerText = _("氏名表示")
document.querySelector(
"#_block_search_advanced_license > div:nth-child(2) > label:nth-child(3)"
).innerText = _("あり")
document.querySelector(
"#_block_search_advanced_license > div:nth-child(2) > label:nth-child(5)"
).innerText = _("なし")
document.querySelector(
"#_block_search_advanced_license > div:nth-child(3) > span:nth-child(1)"
).innerText = _("作品改変")
document.querySelector(
"#_block_search_advanced_license > div:nth-child(3) > label:nth-child(3)"
).innerText = _("改変可")
document.querySelector(
"#_block_search_advanced_license > div:nth-child(3) > label:nth-child(5)"
).innerText = _("改変不可")
document.querySelector(
"#_block_search_advanced_license > div:nth-child(4) > label:nth-child(2)"
).innerText = _("ライセンス条件の付いていない作品")
/**** green button */
document.querySelector(
"input.button_bright"
).value = _("検索")

/** Another green button, but overlaid over the image at top this time, with a link underneath it */
document.querySelector(
"a.button_bright"
).innerText = _("新規会員登録")
document.querySelector(
".logout_cts > p:nth-child(2) > a:nth-child(1)"
).innerText = _("ログインはこちらから") + " >>"

document.querySelector(
"html body div#whole div#main div#index_box.clearfix div#index_main div#top_titlebox div ul.main_nav li.now a#_tab_audio"
).innerText = _("オンガク")
document.querySelector(
"#_tab_image"
).innerText = _("イラスト")
document.querySelector(
"html body div#whole div#main div#index_box.clearfix div#index_main div#top_titlebox div ul.main_nav li a#_tab_text"
).innerText = _("テキスト")
document.querySelector(
"#_tab_3dm"
).innerText = _("3Dモデル")
document.querySelector(
"#top_titlebox > div:nth-child(2) > p:nth-child(2) > a:nth-child(1)"
).innerText = _("オンガク作品一覧»")

document.querySelector(
".tag_box > p:nth-child(1)"
).innerText = _("注目のタグ")
document.querySelector(
".taglist > li:nth-child(1) > a:nth-child(1)"
).innerText = _("明るい")
document.querySelector(
".taglist > li:nth-child(2) > a:nth-child(1)"
).innerText = _("シューゲイザー")
document.querySelector(
".taglist > li:nth-child(3) > a:nth-child(1)"
).innerText = _("キラキラ")
document.querySelector(
".taglist > li:nth-child(4) > a:nth-child(1)"
).innerText = _("花")
document.querySelector(
".taglist > li:nth-child(5) > a:nth-child(1)"
).innerText = _("テクノポップ")
document.querySelector(
".taglist > li:nth-child(6) > a:nth-child(1)"
).innerText = _("ハウス")
document.querySelector(
".taglist > li:nth-child(7) > a:nth-child(1)"
).innerText = _("童謡")
document.querySelector(
".tag_box > p:nth-child(2) > a:nth-child(1)"
).innerText = _("タグ一覧") + " »"
document.querySelector(
".taglist > li:nth-child(6) > a:nth-child(1)"
).innerText = _("キラキラ")
document.querySelector(
".taglist > li:nth-child(7) > a:nth-child(1)"
).innerText = _("花")

document.querySelector(
"span.now > a:nth-child(1)"
).innerText = _("全て")
document.querySelector(
".cv_link > span:nth-child(2) > a:nth-child(1)"
).innerText = _("MEIKO")
document.querySelector(
".cv_link > span:nth-child(3) > a:nth-child(1)"
).innerText = _("KAITO")
document.querySelector(
".cv_link > span:nth-child(4) > a:nth-child(1)"
).innerText = _("初音ミク")
document.querySelector(
".cv_link > span:nth-child(5) > a:nth-child(1)"
).innerText = _("鏡音リン")
document.querySelector(
".cv_link > span:nth-child(6) > a:nth-child(1)"
).innerText = _("鏡音レン")
document.querySelector(
".cv_link > span:nth-child(7) > a:nth-child(1)"
).innerText = _("巡音ルカ")
document.querySelector(
".cv_link > span:nth-child(8) > a:nth-child(1)"
).innerText = _("その他")

/** Below a picture of Miku */
document.querySelector(
"div.ifootlink:nth-child(4) > a:nth-child(1)"
).innerText = _("公式コラボ一覧") + " »"

/** Below a different thing on the side */
document.querySelector(
"div.sideinfo:nth-child(4) > div:nth-child(3) > a:nth-child(1)"
).innerText = _("もっとみる") + " »"

/** Below a different thing on the side */
document.querySelector(
"div.sideinfo:nth-child(5) > div:nth-child(3) > a:nth-child(1)"
).innerText = _("初音ミク公式ブログへ") + " »"

/** There's a twitter link on the side for some reason. */
document.querySelector(
".twitter-timeline"
).innerText = _("@piaproさんのツイート")

/** Below the Karent thing */
document.querySelector(
"div.sideinfo:nth-child(7) > div:nth-child(3) > a:nth-child(1)"
).innerText = _("KARENTページへ") + " »"

/** Light Bulb thing? */
document.querySelector(
".color_box01 > a:nth-child(1)"
).innerText = _("お問い合せはこちらから")

/** Grey footer at the bottom */
document.querySelector(
"#footer_menu > a:nth-child(1)"
).innerText = _("ヘルプ")
document.querySelector(
"#footer_menu > a:nth-child(3)"
).innerText = _("サイト動作環境")
document.querySelector(
"#footer_menu > a:nth-child(5)"
).innerText = _("キャラクター利用のガイドライン")
document.querySelector(
"#footer_menu > a:nth-child(7)"
).innerText = _("利用規約")
document.querySelector(
"#footer_menu > a:nth-child(9)"
).innerText = _("プライバシーポリシー")
document.querySelector(
"#footer_menu > a:nth-child(11)"
).innerText = _("お問い合わせ")
document.querySelector(
"#footer_menu > a:nth-child(13)"
).innerText = _("CVシリーズ")
document.querySelector(
"#footer_menu > a:nth-child(15)"
).innerText = _("KARENT")
document.querySelector(
"#footer_menu > a:nth-child(17)"
).innerText = _("ABOUT US")
});


Loading…
Cancel
Save