angular-t9n
Version:
A translation tool for Angular i18n
3 lines (2 loc) • 8.49 kB
JavaScript
import{a as le}from"./chunk-6NYZCEZT.js";import{a as ae,b as _e}from"./chunk-GKXKJW7N.js";import{a as me,b as ce,c as pe,d as se,e as Te,f as fe,g as Re,h as Pe,i as Ae,j as Ee,k as Ce,l as Ne,m as Se,n as Oe}from"./chunk-F5XE4YAN.js";import{a as re,b as de}from"./chunk-YO72B5SH.js";import{a as ne,b as ie,c as oe}from"./chunk-MFCYHQDO.js";import{a as Me}from"./chunk-MPLUJE7X.js";import{d as Z,f as ee,g as te}from"./chunk-6DDCRX73.js";import"./chunk-FK6IRHWX.js";import"./chunk-4NKRI2IB.js";import"./chunk-NRGBO6B5.js";import"./chunk-XUIN44YA.js";import{Ab as T,Bb as f,Db as K,Hb as d,Ib as M,Ic as U,Jb as Q,Kc as W,Lc as Y,Q as j,Ta as a,U as O,X as F,Xb as r,Yb as p,Zb as g,ac as u,cb as J,da as C,dc as A,ec as E,g as B,hb as s,ia as V,ja as q,q as S,wb as P,xb as n,yb as i,zb as N}from"./chunk-IRWV2DJQ.js";import{c as z}from"./chunk-4CLCTAJ7.js";var ge=()=>["distance","id","description","meaning","source","target","state","action"];function ue(e,t){if(e&1&&(n(0,"dl")(1,"dt"),d(2,2),i(),n(3,"dd"),r(4),i(),n(5,"dt"),d(6,3),i(),n(7,"dd"),r(8),i(),n(9,"dt"),d(10,4),i(),n(11,"dd",36),r(12),i(),n(13,"dt"),d(14,5),i(),n(15,"dd",37),r(16),i(),n(17,"dt"),d(18,6),i(),n(19,"dd"),r(20),A(21,"titlecase"),i()()),e&2){let o=t.ngIf;a(4),p(o.description||"-"),a(4),p(o.meaning||"-"),a(4),p(o.source),a(4),p(o.target),a(4),p(E(21,5,o.state))}}function he(e,t){e&1&&(n(0,"th",38),d(1,7),i())}function $e(e,t){if(e&1&&(n(0,"td",39),r(1),i()),e&2){let o=t.$implicit;a(),g(" ",o.distance," ")}}function be(e,t){e&1&&(n(0,"th",40),d(1,8),i())}function He(e,t){if(e&1&&(n(0,"td",41),r(1),i()),e&2){let o=t.$implicit;P("matTooltip",o.locations==null?null:o.locations.join(`
`))("matTooltipDisabled",!(o.locations!=null&&o.locations.length)),a(),g(" ",o.id," ")}}function Ge(e,t){e&1&&(n(0,"th",40),d(1,9),i())}function Ie(e,t){if(e&1&&(n(0,"td",42),r(1),i()),e&2){let o=t.$implicit;a(),p(o.description)}}function ye(e,t){e&1&&(n(0,"th",40),d(1,10),i())}function De(e,t){if(e&1&&(n(0,"td",42),r(1),i()),e&2){let o=t.$implicit;a(),p(o.meaning)}}function xe(e,t){e&1&&(n(0,"th",40),d(1,11),i())}function ve(e,t){if(e&1&&(n(0,"td",42),r(1),i()),e&2){let o=t.$implicit;a(),p(o.source)}}function Le(e,t){e&1&&(n(0,"th",40),d(1,12),i())}function Xe(e,t){if(e&1&&(n(0,"td",42),r(1),i()),e&2){let o=t.$implicit;a(),p(o.target)}}function we(e,t){e&1&&(n(0,"th",40),d(1,13),i())}function ke(e,t){if(e&1&&(n(0,"td",42),r(1),A(2,"titlecase"),i()),e&2){let o=t.$implicit;a(),p(E(2,1,o.state))}}function ze(e,t){e&1&&N(0,"th",43)}function Be(e,t){if(e&1){let o=K();n(0,"td",42)(1,"button",44),M("click",function(){let m=V(o).$implicit,c=Q();return q(c.migrate(m))}),n(2,"mat-icon"),r(3,"input"),i()()()}}function je(e,t){e&1&&N(0,"tr",45)}function Fe(e,t){e&1&&N(0,"tr",46)}var ct=(()=>{let t=class t{constructor(){this._translationTargetService=C(Me),this._route=C(Z),this._router=C(ee),this._snackbar=C(le),this._destroy=new B,this.params=this._route.params.pipe(S(c=>{var R=c,{orphanId:_}=R,m=z(R,["orphanId"]);return m})),this.orphan=this._route.paramMap.pipe(O(_=>this._translationTargetService.orphan(_.get("orphanId"))),F(_=>this._orphan=_),j()),this.similar=this.orphan.pipe(S(_=>_._embedded.similar))}ngOnDestroy(){this._destroy.next(),this._destroy.complete()}migrate(_){this.orphan&&this._orphanAction(this._translationTargetService.migrateOrphan(this._orphan,_),`Migrated orphan ${this._orphan.id} to unit ${_.id}`)}delete(){this.orphan&&this._orphanAction(this._translationTargetService.deleteOrphan(this._orphan),`Deleted orphan ${this._orphan.id}`)}_orphanAction(_,m){_.pipe(O(({orphansRemaining:c})=>this._router.navigate([c?"..":"../.."],{relativeTo:this._route}))).subscribe(()=>this._snackbar.open(m,void 0,{duration:2500}))}};t.\u0275fac=function(m){return new(m||t)},t.\u0275cmp=J({type:t,selectors:[["t9n-orphan"]],decls:43,vars:17,consts:()=>{let _;_=$localize`:␟a449a33f34e3a6c40b82058c0d69ff39a9f1e925␟2250356394431390492:Similar units`;let m;m=$localize`:␟c9ed6d0fde000bbbca6abfd191c853b5d1306719␟149862035788373642:Distance according to the levenshtein algorithm`;let c;c=$localize`:␟c9ed6d0fde000bbbca6abfd191c853b5d1306719␟149862035788373642:Distance according to the levenshtein algorithm`;let R;R=$localize`:␟cda31dbd724cf5f4fa7a4274d9120651490c8a8c␟8890553633144307762:Back`;let h;h=$localize`:␟53150cdcaa3fc290a4f4018e446e44b998f1f155␟5246620794703463867: Delete orphan `;let $;$=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let b;b=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let H;H=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`;let G;G=$localize`:␟38baeb215c17af9d9e295e371a57f4a48ab4c191␟4854396465510517671:Target`;let I;I=$localize`:␟873b72903b1858a9cd6c8967521030b4d7d1435b␟5911214550882917183:State`;let y;y=$localize`:␟33f0509c876e1399d92a9d1882ce38e6f4245ce3␟2590415407309830681: Distance `;let D;D=$localize`:␟2798cc1e152b1ec07fd8daf94a2a073d1ba1ebcc␟7286430803380181008:Id`;let x;x=$localize`:␟eec715de352a6b114713b30b640d319fa78207a0␟4902817035128594900:Description`;let v;v=$localize`:␟f2081dbd0b230b2e61d03f870d85af5b54aed1ba␟2984907873245479480:Meaning`;let L;L=$localize`:␟6834fa6b43d1ecbdf147c48dd9c4d72f1484571d␟9155608366859514313:Source`;let X;X=$localize`:␟38baeb215c17af9d9e295e371a57f4a48ab4c191␟4854396465510517671:Target`;let w;w=$localize`:␟873b72903b1858a9cd6c8967521030b4d7d1435b␟5911214550882917183:State`;let k;return k=$localize`:␟ed06ba25f8b8effadedaa466355f5b85b0041712␟7936624992717622100:Migrate translation and state to this unit and remove this orphan.`,[R,h,$,b,H,G,I,y,D,x,v,L,X,w,[4,"ngIf"],[1,"mat-elevation-z1"],["mat-table","","matSort","","aria-label",_,3,"dataSource"],["matColumnDef","distance"],["mat-header-cell","","matTooltip",m,4,"matHeaderCellDef"],["mat-cell","","matTooltip",c,4,"matCellDef"],["matColumnDef","id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","","matTooltipClass","tooltip-linebreak",3,"matTooltip","matTooltipDisabled",4,"matCellDef"],["matColumnDef","description"],["mat-cell","",4,"matCellDef"],["matColumnDef","meaning"],["matColumnDef","source"],["matColumnDef","target"],["matColumnDef","state"],["matColumnDef","action"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"actions"],["mat-raised-button","","color","primary","routerLink","..",3,"queryParams"],["type","button","mat-raised-button","","color","warn",3,"click"],[1,"source"],[1,"target"],["mat-header-cell","","matTooltip",m],["mat-cell","","matTooltip",c],["mat-header-cell","","mat-sort-header",""],["mat-cell","","matTooltipClass","tooltip-linebreak",3,"matTooltip","matTooltipDisabled"],["mat-cell",""],["mat-header-cell",""],["type","button","mat-icon-button","","matTooltip",k,3,"click"],["mat-header-row",""],["mat-row",""]]},template:function(m,c){if(m&1&&(n(0,"h2"),r(1),A(2,"async"),i(),s(3,ue,22,7,"dl",14),A(4,"async"),n(5,"div",15)(6,"table",16),A(7,"async"),T(8,17),s(9,he,2,0,"th",18)(10,$e,2,1,"td",19),f(),T(11,20),s(12,be,2,0,"th",21)(13,He,2,3,"td",22),f(),T(14,23),s(15,Ge,2,0,"th",21)(16,Ie,2,1,"td",24),f(),T(17,25),s(18,ye,2,0,"th",21)(19,De,2,1,"td",24),f(),T(20,26),s(21,xe,2,0,"th",21)(22,ve,2,1,"td",24),f(),T(23,27),s(24,Le,2,0,"th",21)(25,Xe,2,1,"td",24),f(),T(26,28),s(27,we,2,0,"th",21)(28,ke,3,3,"td",24),f(),T(29,29),s(30,ze,1,0,"th",30)(31,Be,4,0,"td",24),f(),s(32,je,1,0,"tr",31)(33,Fe,1,0,"tr",32),i()(),n(34,"div",33)(35,"a",34),A(36,"async"),n(37,"mat-icon"),r(38,"keyboard_backspace"),i(),T(39),d(40,0),f(),i(),n(41,"button",35),M("click",function(){return c.delete()}),d(42,1),i()()),m&2){let R;a(),p((R=E(2,7,c.orphan))==null?null:R.id),a(2),P("ngIf",E(4,9,c.orphan)),a(3),P("dataSource",E(7,11,c.similar)),a(26),P("matHeaderRowDef",u(15,ge))("matHeaderRowDefSticky",!0),a(),P("matRowDefColumns",u(16,ge)),a(2),P("queryParams",E(36,13,c.params))}},dependencies:[U,Oe,se,fe,Ee,Re,Te,Ce,Pe,Ae,Ne,Se,pe,me,ce,de,re,oe,ie,ne,_e,ae,te,W,Y],styles:["[_nghost-%COMP%]{display:block;padding:0 1.5rem 1.5rem}.source[_ngcontent-%COMP%], .target[_ngcontent-%COMP%]{white-space:pre-wrap}table[_ngcontent-%COMP%]{margin-bottom:1rem}.actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0});let e=t;return e})();export{ct as OrphanComponent};