Description
Currently we do not have any special handling of the language button or menu for the situation where an article has no other available languages. Below are the details for our short-term solution.
Design
Acceptance criteria
- Empty state button must have label: "Add languages"
- Selecting the empty state button would trigger a modal with the text: "This article is not currently available in other languages. You can help to create translations"
- Link to Content Translation special page with the current article selected (see T275147#6863710 for details). Link similar to:
Developer note
Will require a change in the ULS extension
diff --git a/lib/jquery.uls/src/jquery.uls.core.js b/lib/jquery.uls/src/jquery.uls.core.js index 86615788..08915c6a 100644 --- a/lib/jquery.uls/src/jquery.uls.core.js +++ b/lib/jquery.uls/src/jquery.uls.core.js @@ -263,6 +263,9 @@ // Handle key press events on the menu this.$menu.on( 'keydown', this.keypress.bind( this ) ); + if ( !Object.keys( this.languages ).length ) { + this.$resultsView.append( $( '<div>no results</div>' ) ); // @todo: style per mock. + } this.createLanguageFilter(); this.$languageFilter.on( 'resultsfound.uls', this.success.bind( this ) );
After performing a search, we'll need to hide this default view (either via CSS or JS)
The translation link will be dependent on whether ULS is installed or not which adds configuration checks.