Changeset 11051
- Timestamp:
- 06/21/2021 08:02:08 PM (4 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/helper-functions.php
r11043 r11051 314 314 <?php 315 315 } 316 317 /** 318 * Whether to show the context or not. 319 * 320 * Prevents displaying the context if it doesn't provide any new information 321 * to the translator. 322 * Especially for mobile projects the context is mostly a duplicate of the singular string. 323 * 324 * @param \Translation_Entry $translation Current translation entry. 325 * @return bool Whether to show the context or not. 326 */ 327 function wporg_gp_should_display_original_context( $translation ) { 328 // No context available. 329 if ( ! $translation->context ) { 330 return false; 331 } 332 333 // Context is the same as the singular. 334 if ( $translation->singular === $translation->context ) { 335 return false; 336 } 337 338 // Context was cut-off due to VARCHAR(255) in the database schema. 339 if ( 255 === mb_strlen( $translation->context ) && 0 === strpos( $translation->singular, $translation->context ) ) { 340 return false; 341 } 342 343 return true; 344 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/style.css
r11042 r11051 346 346 } 347 347 348 span.context { 349 font-size: 90%; 348 span.context, 349 span.priority { 350 color: #1e1e1e; 351 font-size: 12px; 350 352 padding: .1em 0; 351 353 margin-left: .2em; … … 354 356 box-decoration-break: clone; 355 357 box-shadow: .3em 0 0 #a0a5aa, -.3em 0 0 #a0a5aa; 358 border-radius: 0; 359 } 360 361 span.context + span.priority { 362 margin-left: 1em; 363 } 364 365 .priority-high span.priority { 366 color: #fff; 367 background-color: rgba( 154, 35, 35, 0.65 ); 368 box-shadow: 0.3em 0 0 rgba( 154, 35, 35, 0.65 ), -0.3em 0 0 rgba( 154, 35, 35, 0.65 ); 369 } 370 371 .priority-low span.priority { 372 background-color: rgba( 213, 213, 213, 0.65 ); 373 box-shadow: 0.3em 0 0 rgba( 213, 213, 213, 0.65 ), -0.3em 0 0 rgba( 213, 213, 213, 0.65 ); 356 374 } 357 375 … … 384 402 } 385 403 386 table.translations td.original ul:not(:last-child), 387 table.translations td.translation ul:not(:last-child) { 388 margin-bottom: .2em; 404 .original-tags { 405 margin-top: .2em; 389 406 } 390 407 … … 448 465 449 466 table.translations tr:nth-child(4n+3), 467 table.locale-sub-projects tr:nth-child(even), 450 468 .translation-sets tr, 451 469 .locales tr { … … 1011 1029 float: right; 1012 1030 width: 250px; 1013 border: 1px solid # ccc;1031 border: 1px solid #72777c; 1014 1032 box-shadow: 0 1px 1px -1px rgba(0,0,0,0.1); 1015 1033 background: #fff; … … 1025 1043 margin: 0 0 2.083% 2.083%; 1026 1044 width: 47.917%; 1027 border: 1px solid # ccc;1045 border: 1px solid #72777c; 1028 1046 box-shadow: 0 1px 1px -1px rgba(0,0,0,0.1); 1029 1047 background: #fff; … … 1053 1071 .projects .project-name h4 { 1054 1072 border: 0; 1055 margin: 0 0 12px;1073 margin: 0 0 8px; 1056 1074 font-size: 18px; 1057 1075 font-weight: 600; … … 1061 1079 .projects .project-description { 1062 1080 font-size: 13px; 1081 border-left: 0; 1082 margin-top: 0; 1083 padding: 0; 1063 1084 } 1064 1085 … … 1170 1191 margin-left: 0; 1171 1192 max-width: 100%; 1193 padding: 0; 1194 border: 0; 1172 1195 } 1173 1196 … … 1176 1199 width: 350px; 1177 1200 margin-left: 20px; 1178 border: 1px solid # ccc;1201 border: 1px solid #72777c; 1179 1202 box-shadow: 0 1px 1px -1px rgba(0,0,0,0.1); 1180 1203 background: #fff; … … 1266 1289 1267 1290 ul.projects-dropdown { 1268 border-top: 1px solid # ccc;1291 border-top: 1px solid #72777c; 1269 1292 } 1270 1293 … … 1298 1321 width: 100%; 1299 1322 background: #f9f9f9; 1300 border: 1px solid # ccc;1323 border: 1px solid #72777c; 1301 1324 border-top: 0; 1302 1325 box-shadow: 1px 1px 1px 0 rgba(0,0,0,0.04); … … 1642 1665 float: right; 1643 1666 margin: -30px 0 5px 5px; 1644 background-color: # 72777c;1667 background-color: #e2e4e7; 1645 1668 padding: 5px; 1646 1669 border: 1px solid #dfdfdf; … … 1887 1910 .locale-project-contributors-group hr { 1888 1911 margin: 30px 0; 1912 border-color: #72777c; 1889 1913 } 1890 1914 … … 2311 2335 } 2312 2336 2313 table.translations th.priority {2314 width: 2em; 2315 text-align: center;2337 table.translations th.priority, 2338 table.translations td.priority { 2339 display: none; 2316 2340 } 2317 2341 … … 2588 2612 } 2589 2613 2590 .source-details details + details {2614 .source-details details + details { 2591 2615 margin-top: 5px; 2592 2616 } … … 2595 2619 word-wrap: break-word; 2596 2620 overflow-wrap: break-word; 2621 } 2622 2623 .source-details__context .context { 2624 font-size: 100%; 2625 background: transparent; 2626 box-shadow: none; 2627 margin: 0; 2628 padding: 0; 2597 2629 } 2598 2630 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row-preview.php
r11042 r11051 41 41 <?php 42 42 endif; 43 ?> 43 44 44 if ( $translation->context ) : 45 <div class="original-tags"> 46 <?php 47 if ( wporg_gp_should_display_original_context( $translation ) ) : 48 ?> 49 <span class="context bubble"><?php echo esc_html( $translation->context ); ?></span> 50 <?php 51 endif; 52 53 if ( '1' === $translation->priority || '-1' === $translation->priority ) : 54 ?> 55 <span class="priority bubble"><?php echo esc_html( sprintf( 'Priority: %s', gp_array_get( GP::$original->get_static( 'priorities' ), $translation->priority ) ) ); ?></span> 56 <?php 57 endif; 45 58 ?> 46 <span class="context bubble"><?php echo esc_html( $translation->context ); ?></span> 47 <?php 48 endif; 49 ?> 59 </div> 50 60 </td> 51 61 <td class="translation foreign-text">
Note: See TracChangeset
for help on using the changeset viewer.