Skip to content

Commit

Permalink
Add support for Armenian language scripts, fix textbox heading color …
Browse files Browse the repository at this point in the history
…& clone attribution bugs (#696)

* Add support for Armenian language scripts.

* Make sure headings in textbox_header class receive header color value.

* Place word 'by' inside of conditional statement for publisher clone attribution.

* Add comment for translators
  • Loading branch information
SteelWagstaff authored May 22, 2020
1 parent e3c8785 commit f0518bf
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 3 deletions.
15 changes: 15 additions & 0 deletions assets/book/typography/styles/_NotoSansArmenianFont.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 'Noto Sans Armenian', @import 'NotoSansArmenianFont'

@font-face {
font-family: 'Noto Sans Armenian';
font-style: normal;
font-weight: 400;
src: url('uploads/assets/fonts/NotoSansArmenian-Regular.ttf') format('truetype');
}

@font-face {
font-family: 'Noto Sans Armenian';
font-style: bold;
font-weight: 700;
src: url('uploads/assets/fonts/NotoSansArmenian-Bold.ttf') format('truetype');
}
2 changes: 1 addition & 1 deletion assets/book/typography/styles/_NotoSansDevanagariFont.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@font-face {
font-family: 'Noto Sans Devanagari';
font-style: normal;
font-style: bold;
font-weight: 700;
src: url('uploads/assets/fonts/NotoSansDevanagari-Bold.ttf') format('truetype');
}
15 changes: 15 additions & 0 deletions assets/book/typography/styles/_NotoSerifArmenianFont.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 'Noto Serif Armenian', @import 'NotoSerifArmenianFont'

@font-face {
font-family: 'Noto Serif Armenian';
font-style: normal;
font-weight: 400;
src: url('uploads/assets/fonts/NotoSerifArmenian-Regular.ttf') format('truetype');
}

@font-face {
font-family: 'Noto Serif Armenian';
font-style: bold;
font-weight: 700;
src: url('uploads/assets/fonts/NotoSerifArmenian-Bold.ttf') format('truetype');
}
13 changes: 13 additions & 0 deletions assets/book/typography/styles/_fonts-hy.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@import 'NotoSansArmenianFont', 'NotoSerifArmenianFont';

// Sans-serif stack name

$sans-serif-epub-hy: 'Noto Sans Armenian';
$sans-serif-prince-hy: 'Noto Sans Armenian';
$sans-serif-web-hy: 'Noto Sans Armenian';

// Serif stack-name

$serif-epub-hy: 'Noto Serif Armenian';
$serif-prince-hy: 'Noto Serif Armenian';
$serif-web-hy: 'Noto Serif Armenian';
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
if-map-get($edu-textbox-padding-left, $type);
text-align: $edu-header-text-align;

h1, h2, h3, h4, h5, h6 {
color: $header-color;
}

p {
text-indent: 0;
}
Expand Down
5 changes: 3 additions & 2 deletions partials/content-cover-book-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@
$authors = \PressbooksBook\Helpers\get_book_authors( $source_meta );
printf(
/* translators: %$1s: title of book, link to book, %2$s: attribution string for the book, %3$s: publisher of book, %4$s: license for book */
__( 'This book is a cloned version of %1$s%2$s, published using Pressbooks by %3$s under a %4$s license. It may differ from the original.', 'pressbooks-book' ),
__( 'This book is a cloned version of %1$s%2$s, published using Pressbooks%3$s under a %4$s license. It may differ from the original.', 'pressbooks-book' ),
sprintf( '<a href="%1$s">%2$s</a>', $source_url, $source_meta['name'] ),
/* translators: %2$s: authors of book */
( $authors ) ? sprintf( __( ' by %s', 'pressbooks-book' ), $authors ) : '',
( isset( $source_meta['publisher'] ) ) ? $source_meta['publisher']['name'] : '',
/* translators: %3$s: publisher of book */
( isset( $source_meta['publisher'] ) ) ? sprintf( __( ' by %s', 'pressbooks-book' ), $source_meta['publisher']['name'] ) : '',
sprintf( '<a href="%1$s">%2$s</a>', $source_meta['license']['url'], $source_meta['license']['name'] )
);
} else {
Expand Down

0 comments on commit f0518bf

Please sign in to comment.