-
Notifications
You must be signed in to change notification settings - Fork 141
Test translation context Danger plugin #15539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Changes from all commits
1a2b24c
e20f1a3
61575c6
917cc50
00e1be3
451d5d8
8c526a8
7be41c1
231fdf7
6e60134
0566153
d56b0b2
f3c3a4e
a321826
595ce9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| package com.woocommerce.android.ui.test | ||
|
|
||
| import android.os.Bundle | ||
| import android.view.LayoutInflater | ||
| import android.view.View | ||
| import android.view.ViewGroup | ||
| import android.widget.Button | ||
| import android.widget.EditText | ||
| import android.widget.TextView | ||
| import androidx.fragment.app.Fragment | ||
| import com.woocommerce.android.R | ||
|
|
||
| /** | ||
| * Test fragment for exercising translation context suggestions. | ||
| * This file is intentionally added to test the translation context Danger plugin. | ||
| */ | ||
| class TranslationContextTestFragment : Fragment() { | ||
|
|
||
| override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
| super.onViewCreated(view, savedInstanceState) | ||
|
|
||
| val saveButton = view.findViewById<Button>(R.id.save_button) | ||
| saveButton.text = getString(R.string.test_order_action_save) | ||
|
|
||
| val statusLabel = view.findViewById<TextView>(R.id.status_label) | ||
| statusLabel.text = getString(R.string.test_order_status_processing) | ||
|
|
||
| val titleLabel = view.findViewById<TextView>(R.id.title_label) | ||
| titleLabel.text = getString(R.string.test_store_settings_title) | ||
|
|
||
| val noteField = view.findViewById<EditText>(R.id.note_field) | ||
| noteField.hint = getString(R.string.test_product_note_placeholder) | ||
|
|
||
| val closeButton = view.findViewById<Button>(R.id.close_button) | ||
| closeButton.contentDescription = getString(R.string.test_shipping_label_close) | ||
|
|
||
| val draftBadge = view.findViewById<TextView>(R.id.draft_badge) | ||
| draftBadge.text = getString(R.string.test_order_draft_status) | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4506,4 +4506,13 @@ | |||||||||
| <string name="woo_pos_promo_page5_description">Use with WooPayments or Stripe payment gateways.</string> | ||||||||||
| <string name="woo_pos_promo_next_button">Next</string> | ||||||||||
| <string name="woo_pos_promo_explore_button">Explore WooCommerce POS</string> | ||||||||||
|
|
||||||||||
| <!-- Translation Context Plugin Test Strings --> | ||||||||||
| <string name="test_order_action_save">Save</string> | ||||||||||
| <string name="test_order_status_processing">Processing</string> | ||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Generated by 🚫 Danger |
||||||||||
| <!-- Screen title --> | ||||||||||
| <string name="test_store_settings_title">Settings</string> | ||||||||||
|
Comment on lines
+4513
to
+4514
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| <string name="test_product_note_placeholder">Add a note</string> | ||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Generated by 🚫 Danger |
||||||||||
| <string name="test_shipping_label_close">Close</string> | ||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Generated by 🚫 Danger |
||||||||||
| <string name="test_order_draft_status">Draft</string> | ||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Generated by 🚫 Danger |
||||||||||
| </resources> | ||||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting that it suggests a max length here (presumably in order for the text to fit the design)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it can return the length if it figures it out somehow based on the context. Though I tweaked the system prompt related to that a little bit, so it adds it only when it has a higher certainty.